feat(server): Nullable asset dates (#15669)

* nullable dates

* wip

* don't search for null dates

* Add placeholder type

* cleanup
This commit is contained in:
Jonathan Jogenfors
2025-02-13 22:30:12 +01:00
committed by GitHub
parent f5edc87e4d
commit 5407a28533
13 changed files with 100 additions and 11 deletions

View File

@@ -503,7 +503,7 @@ export class LibraryService extends BaseService {
}
const mtime = stat.mtime;
const isAssetModified = mtime.toISOString() !== asset.fileModifiedAt.toISOString();
const isAssetModified = !asset.fileModifiedAt || mtime.toISOString() !== asset.fileModifiedAt.toISOString();
if (asset.isOffline || isAssetModified) {
this.logger.debug(`Asset was offline or modified, updating asset record ${asset.originalPath}`);

View File

@@ -171,6 +171,14 @@ export class MetadataService extends BaseService {
this.logger.verbose('Exif Tags', exifTags);
if (!asset.fileCreatedAt) {
asset.fileCreatedAt = stats.mtime;
}
if (!asset.fileModifiedAt) {
asset.fileModifiedAt = stats.mtime;
}
const { dateTimeOriginal, localDateTime, timeZone, modifyDate } = this.getDates(asset, exifTags);
const { latitude, longitude, country, state, city } = await this.getGeo(exifTags, reverseGeocoding);