From 0431ce67e2b88612acd2783ad49fb35be64b4ef2 Mon Sep 17 00:00:00 2001 From: Veronika <24509509+desertwitch@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:48:08 +0100 Subject: [PATCH 1/3] No negative EXIF ratings --- src/backend/model/threading/MetadataLoader.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/model/threading/MetadataLoader.ts b/src/backend/model/threading/MetadataLoader.ts index ab794f1f..421143ac 100644 --- a/src/backend/model/threading/MetadataLoader.ts +++ b/src/backend/model/threading/MetadataLoader.ts @@ -221,6 +221,7 @@ export class MetadataLoader { const exif = ExifReader.load(data); if (exif.Rating) { metadata.rating = (parseInt(exif.Rating.value, 10) as any); + if(metadata.rating < 0) { metadata.rating = 0; } } if (exif.subject && exif.subject.value && exif.subject.value.length > 0) { if (metadata.keywords === undefined) { From e09d006505cc4b0a5bf8d21af33d49a75ee80abb Mon Sep 17 00:00:00 2001 From: Veronika <24509509+desertwitch@users.noreply.github.com> Date: Tue, 18 Jan 2022 13:41:35 +0100 Subject: [PATCH 2/3] Fix no folder previews on directory search results --- src/backend/model/database/sql/GalleryManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/model/database/sql/GalleryManager.ts b/src/backend/model/database/sql/GalleryManager.ts index 70a46992..10b555fd 100644 --- a/src/backend/model/database/sql/GalleryManager.ts +++ b/src/backend/model/database/sql/GalleryManager.ts @@ -222,7 +222,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager { */ public async fillPreviewForSubDir(connection: Connection, dir: SubDirectoryDTO): Promise { - if (!dir.validPreview) { + if (!dir.preview || !dir.validPreview) { dir.preview = await ObjectManagers.getInstance().PreviewManager.setAndGetPreviewForDirectory(dir); } From 55f2748cfd54e69507911e4609736a84f7d9ffd2 Mon Sep 17 00:00:00 2001 From: Veronika <24509509+desertwitch@users.noreply.github.com> Date: Tue, 18 Jan 2022 14:51:07 +0100 Subject: [PATCH 3/3] Revert "Fix no folder previews on directory search results" This reverts commit e09d006505cc4b0a5bf8d21af33d49a75ee80abb. --- src/backend/model/database/sql/GalleryManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/model/database/sql/GalleryManager.ts b/src/backend/model/database/sql/GalleryManager.ts index 10b555fd..70a46992 100644 --- a/src/backend/model/database/sql/GalleryManager.ts +++ b/src/backend/model/database/sql/GalleryManager.ts @@ -222,7 +222,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager { */ public async fillPreviewForSubDir(connection: Connection, dir: SubDirectoryDTO): Promise { - if (!dir.preview || !dir.validPreview) { + if (!dir.validPreview) { dir.preview = await ObjectManagers.getInstance().PreviewManager.setAndGetPreviewForDirectory(dir); }