mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
adding file creation time as fallback to video creation time
This commit is contained in:
parent
6d44c22df1
commit
976e50d310
@ -33,6 +33,7 @@ export class MetadataLoader {
|
|||||||
try {
|
try {
|
||||||
const stat = fs.statSync(fullPath);
|
const stat = fs.statSync(fullPath);
|
||||||
metadata.fileSize = stat.size;
|
metadata.fileSize = stat.size;
|
||||||
|
metadata.creationDate = stat.ctime.getTime();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -55,13 +56,14 @@ export class MetadataLoader {
|
|||||||
if (Utils.isInt32(parseInt(data.streams[i].bit_rate, 10))) {
|
if (Utils.isInt32(parseInt(data.streams[i].bit_rate, 10))) {
|
||||||
metadata.bitRate = parseInt(data.streams[i].bit_rate, 10) || null;
|
metadata.bitRate = parseInt(data.streams[i].bit_rate, 10) || null;
|
||||||
}
|
}
|
||||||
metadata.creationDate = Date.parse(data.streams[i].tags.creation_time);
|
metadata.creationDate = Date.parse(data.streams[i].tags.creation_time) || metadata.creationDate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
}
|
}
|
||||||
|
metadata.creationDate = metadata.creationDate || 0;
|
||||||
|
|
||||||
return resolve(metadata);
|
return resolve(metadata);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user