Merge branch 'main' of https://github.com/immich-app/immich into fix/modal-sticky-bottom

This commit is contained in:
ben-basten
2024-09-14 11:57:45 -04:00
3 changed files with 19 additions and 2 deletions

View File

@@ -1095,6 +1095,18 @@ describe(MetadataService.name, () => {
expect(personMock.updateAll).toHaveBeenCalledWith([]);
expect(jobMock.queueAll).toHaveBeenCalledWith([]);
});
it('should handle invalid modify date', async () => {
assetMock.getByIds.mockResolvedValue([assetStub.image]);
metadataMock.readTags.mockResolvedValue({ ModifyDate: '00:00:00.000' });
await sut.handleMetadataExtraction({ id: assetStub.image.id });
expect(assetMock.upsertExif).toHaveBeenCalledWith(
expect.objectContaining({
modifyDate: expect.any(Date),
}),
);
});
});
describe('handleQueueSidecar', () => {

View File

@@ -629,11 +629,16 @@ export class MetadataService {
this.logger.debug(`Asset ${asset.id} local time is offset by ${offsetMinutes} minutes`);
}
let modifyDate = asset.fileModifiedAt;
try {
modifyDate = (exifTags.ModifyDate as ExifDateTime)?.toDate() ?? modifyDate;
} catch {}
return {
dateTimeOriginal,
timeZone,
localDateTime,
modifyDate: (exifTags.ModifyDate as ExifDateTime)?.toDate() ?? asset.fileModifiedAt,
modifyDate,
};
}

View File

@@ -74,7 +74,7 @@
aria-modal="true"
aria-labelledby={titleId}
>
<div class="immich-scrollbar overflow-y-auto max-h-[min(85dvh,44rem)]">
<div class="immich-scrollbar overflow-y-auto max-h-[min(85dvh,44rem)] py-1">
<ModalHeader id={titleId} {title} {showLogo} {icon} {onClose} />
<div class="px-5 pt-0" class:pb-5={isStickyBottom}>
<slot />