fix(server): never try to parse Duration from exif data (#13497)

This commit is contained in:
Jason Rasmussen
2024-10-16 18:20:44 -04:00
committed by GitHub
parent 8ac40a933a
commit 01a9cda15d
2 changed files with 66 additions and 54 deletions

View File

@@ -339,7 +339,7 @@ export class MetadataService extends BaseService {
const sidecarTags = asset.sidecarPath ? await this.metadataRepository.readTags(asset.sidecarPath) : {};
const videoTags = asset.type === AssetType.VIDEO ? await this.getVideoTags(asset.originalPath) : {};
// make sure dates comes from sidecar
// prefer dates from sidecar tags
const sidecarDate = firstDateTime(sidecarTags as Tags, EXIF_DATE_TAGS);
if (sidecarDate) {
for (const tag of EXIF_DATE_TAGS) {
@@ -347,6 +347,10 @@ export class MetadataService extends BaseService {
}
}
// prefer duration from video tags
delete mediaTags.Duration;
delete sidecarTags.Duration;
return { ...mediaTags, ...videoTags, ...sidecarTags };
}