fix(server): date time calculation (#5204)

This commit is contained in:
Jason Rasmussen 2023-11-20 17:26:53 -05:00 committed by GitHub
parent 30e9763888
commit 8b966a0f15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;