0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-03-11 02:23:09 -05:00

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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 4 deletions

View file

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

View file

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

View file

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

View file

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