fix(server): set modifydate (#16225)

This commit is contained in:
Jonathan Jogenfors
2025-02-20 16:28:30 +01:00
committed by GitHub
parent 9c95adc7fb
commit b0102f8025
4 changed files with 11 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ where
and "isVisible" = $3 and "isVisible" = $3
and "isArchived" = $4 and "isArchived" = $4
and "deletedAt" is null and "deletedAt" is null
and "fileModifiedAt" is not null and "fileCreatedAt" is not null
and "fileModifiedAt" is not null and "fileModifiedAt" is not null
and "localDateTime" is not null and "localDateTime" is not null
@@ -26,7 +26,7 @@ where
and "isVisible" = $2 and "isVisible" = $2
and "isArchived" = $3 and "isArchived" = $3
and "deletedAt" is null and "deletedAt" is null
and "fileModifiedAt" is not null and "fileCreatedAt" is not null
and "fileModifiedAt" is not null and "fileModifiedAt" is not null
and "localDateTime" is not null and "localDateTime" is not null
and "originalPath" like $4 and "originalPath" like $4

View File

@@ -18,7 +18,7 @@ export class ViewRepository {
.where('isVisible', '=', true) .where('isVisible', '=', true)
.where('isArchived', '=', false) .where('isArchived', '=', false)
.where('deletedAt', 'is', null) .where('deletedAt', 'is', null)
.where('fileModifiedAt', 'is not', null) .where('fileCreatedAt', 'is not', null)
.where('fileModifiedAt', 'is not', null) .where('fileModifiedAt', 'is not', null)
.where('localDateTime', 'is not', null) .where('localDateTime', 'is not', null)
.execute(); .execute();
@@ -38,7 +38,7 @@ export class ViewRepository {
.where('isVisible', '=', true) .where('isVisible', '=', true)
.where('isArchived', '=', false) .where('isArchived', '=', false)
.where('deletedAt', 'is', null) .where('deletedAt', 'is', null)
.where('fileModifiedAt', 'is not', null) .where('fileCreatedAt', 'is not', null)
.where('fileModifiedAt', 'is not', null) .where('fileModifiedAt', 'is not', null)
.where('localDateTime', 'is not', null) .where('localDateTime', 'is not', null)
.where('originalPath', 'like', `%${normalizedPath}/%`) .where('originalPath', 'like', `%${normalizedPath}/%`)

View File

@@ -227,6 +227,7 @@ describe(MetadataService.name, () => {
id: assetStub.image.id, id: assetStub.image.id,
duration: null, duration: null,
fileCreatedAt: sidecarDate, fileCreatedAt: sidecarDate,
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
localDateTime: sidecarDate, localDateTime: sidecarDate,
}); });
}); });
@@ -246,6 +247,7 @@ describe(MetadataService.name, () => {
id: assetStub.image.id, id: assetStub.image.id,
duration: null, duration: null,
fileCreatedAt: fileModifiedAt, fileCreatedAt: fileModifiedAt,
fileModifiedAt,
localDateTime: fileModifiedAt, localDateTime: fileModifiedAt,
}); });
}); });
@@ -263,6 +265,7 @@ describe(MetadataService.name, () => {
id: assetStub.image.id, id: assetStub.image.id,
duration: null, duration: null,
fileCreatedAt, fileCreatedAt,
fileModifiedAt,
localDateTime: fileCreatedAt, localDateTime: fileCreatedAt,
}); });
}); });
@@ -297,6 +300,7 @@ describe(MetadataService.name, () => {
id: assetStub.image.id, id: assetStub.image.id,
duration: null, duration: null,
fileCreatedAt: assetStub.image.fileCreatedAt, fileCreatedAt: assetStub.image.fileCreatedAt,
fileModifiedAt: assetStub.image.fileModifiedAt,
localDateTime: assetStub.image.fileCreatedAt, localDateTime: assetStub.image.fileCreatedAt,
}); });
}); });
@@ -319,6 +323,7 @@ describe(MetadataService.name, () => {
id: assetStub.withLocation.id, id: assetStub.withLocation.id,
duration: null, duration: null,
fileCreatedAt: assetStub.withLocation.createdAt, fileCreatedAt: assetStub.withLocation.createdAt,
fileModifiedAt: assetStub.withLocation.createdAt,
localDateTime: new Date('2023-02-22T05:06:29.716Z'), localDateTime: new Date('2023-02-22T05:06:29.716Z'),
}); });
}); });
@@ -840,6 +845,7 @@ describe(MetadataService.name, () => {
id: assetStub.image.id, id: assetStub.image.id,
duration: null, duration: null,
fileCreatedAt: dateForTest, fileCreatedAt: dateForTest,
fileModifiedAt: dateForTest,
localDateTime: dateForTest, localDateTime: dateForTest,
}); });
}); });

View File

@@ -238,6 +238,7 @@ export class MetadataService extends BaseService {
duration: exifTags.Duration?.toString() ?? null, duration: exifTags.Duration?.toString() ?? null,
localDateTime, localDateTime,
fileCreatedAt: exifData.dateTimeOriginal ?? undefined, fileCreatedAt: exifData.dateTimeOriginal ?? undefined,
fileModifiedAt: exifData.modifyDate ?? undefined,
}); });
await this.assetRepository.upsertJobStatus({ await this.assetRepository.upsertJobStatus({