From 8b966a0f15df85b03d28df53fc44c6c1bce566f0 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Mon, 20 Nov 2023 17:26:53 -0500 Subject: [PATCH] fix(server): date time calculation (#5204) --- server/src/domain/metadata/metadata.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/domain/metadata/metadata.service.ts b/server/src/domain/metadata/metadata.service.ts index 45193c2e10..53c6668f3a 100644 --- a/server/src/domain/metadata/metadata.service.ts +++ b/server/src/domain/metadata/metadata.service.ts @@ -39,7 +39,7 @@ interface DirectoryEntry { type ExifEntityWithoutGeocodeAndTypeOrm = Omit< ExifEntity, 'city' | 'state' | 'country' | 'description' | 'exifTextSearchableColumn' ->; +> & { dateTimeOriginal: Date }; const exifDate = (dt: ExifDateTime | string | undefined) => (dt instanceof ExifDateTime ? dt?.toDate() : null); const tzOffset = (dt: ExifDateTime | string | undefined) => (dt instanceof ExifDateTime ? dt?.tzoffsetMinutes : null); @@ -181,7 +181,7 @@ export class MetadataService { await this.applyReverseGeocoding(asset, exifData); await this.assetRepository.upsertExif(exifData); - const dateTimeOriginal = exifDate(firstDateTime(tags as Tags)) ?? exifData.dateTimeOriginal; + const dateTimeOriginal = exifData.dateTimeOriginal; let localDateTime = dateTimeOriginal ?? undefined; const timeZoneOffset = tzOffset(firstDateTime(tags as Tags)) ?? 0;