From ecc4bd0b341fb6e26acd8fe6f0b9bcb08fc5e230 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Tue, 7 Mar 2023 18:56:23 -0800 Subject: [PATCH] all: fix modal calls --- CHANGELOG.md | 2 ++ src/components/Metadata.vue | 20 ++++++++++---------- src/components/SelectionManager.vue | 10 +++++----- src/components/viewer/Viewer.vue | 2 +- src/main.ts | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67a9e550..7a912c27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is manually updated. Please file an issue if something is missing. ## v4.12.0, v3.12.0 +- **Feature**: Allow bulk editing of EXIF attributes other than date/time +- **Feature**: Show list of tags in sidebar - **Feature**: Configurable album sorting order ([#377](https://github.com/pulsejet/memories/issues/377)) - **Feature**: Allow archiving photos throw folder view ([#350](https://github.com/pulsejet/memories/issues/350)) - **Feature**: Add search bar to face cluster merge dialog ([#177](https://github.com/pulsejet/memories/issues/177)) diff --git a/src/components/Metadata.vue b/src/components/Metadata.vue index cd1aafb9..a223d111 100644 --- a/src/components/Metadata.vue +++ b/src/components/Metadata.vue @@ -114,7 +114,7 @@ export default defineComponent({ title: this.dateOriginalStr, subtitle: this.dateOriginalTime, icon: CalendarIcon, - edit: () => globalThis.editDate(globalThis.currentViewerPhoto), + edit: () => globalThis.editMetadata([globalThis.currentViewerPhoto]), }); } @@ -141,7 +141,15 @@ export default defineComponent({ title: title || this.t("memories", "No title"), subtitle: [desc || this.t("memories", "No description")], icon: InfoIcon, - edit: () => globalThis.editExif(globalThis.currentViewerPhoto), + edit: () => globalThis.editMetadata([globalThis.currentViewerPhoto]), + }); + } + + if (this.tagNamesStr) { + list.push({ + title: this.tagNamesStr, + subtitle: [], + icon: TagIcon, }); } @@ -154,14 +162,6 @@ export default defineComponent({ }); } - if (this.tagNamesStr) { - list.push({ - title: this.tagNamesStr, - subtitle: [], - icon: TagIcon, - }); - } - return list; }, diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index 1e8b62d9..d9c51252 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -209,13 +209,13 @@ export default defineComponent({ ]; // Ugly: globally exposed functions - const getSel = (photo: IPhoto) => { + globalThis.editMetadata = (photos: IPhoto[]) => { const sel = new Map(); - sel.set(photo.fileid, photo); - return sel; + for (const photo of photos) { + sel.set(photo.fileid, photo); + } + this.editMetadataSelection(sel); }; - globalThis.editMetadata = (photo: IPhoto) => - this.editMetadataSelection(getSel(photo)); }, watch: { diff --git a/src/components/viewer/Viewer.vue b/src/components/viewer/Viewer.vue index 99bd00de..2868f33d 100644 --- a/src/components/viewer/Viewer.vue +++ b/src/components/viewer/Viewer.vue @@ -1168,7 +1168,7 @@ export default defineComponent({ * Edit Metadata for current photo */ editMetadata() { - globalThis.editMetadata(globalThis.currentViewerPhoto); + globalThis.editMetadata([globalThis.currentViewerPhoto]); }, }, }); diff --git a/src/main.ts b/src/main.ts index 50d76dbb..1b998391 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,7 +22,7 @@ declare global { var OC: Nextcloud.v24.OC; var OCP: Nextcloud.v24.OCP; - var editDate: (photo: IPhoto) => void; + var editMetadata: (photos: IPhoto[]) => void; var currentViewerPhoto: IPhoto; var windowInnerWidth: number; // cache