From 42f32350d9abea2c862aad6d13de42d68957770b Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 29 Oct 2023 12:17:00 -0700 Subject: [PATCH] metadata: revert quick learning Signed-off-by: Varun Patil --- src/components/Metadata.vue | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/components/Metadata.vue b/src/components/Metadata.vue index 981bc9eb..4738e416 100644 --- a/src/components/Metadata.vue +++ b/src/components/Metadata.vue @@ -391,17 +391,6 @@ export default defineComponent({ this.fileid = null; this.exif = {}; - // get photo from id if this is the current viewer photo - if (_m.viewer.currentPhoto?.fileid === photo) { - photo = _m.viewer.currentPhoto; - } - - // try to get as much information as we can from - // the image info already loaded - if (typeof photo === 'object' && photo.imageInfo) { - this.setImageInfo(photo.imageInfo); - } - // which clusters to get const clusters = this.routeIsPublic ? String() @@ -420,7 +409,12 @@ export default defineComponent({ const url = API.Q(utils.getImageInfoUrl(photo), { tags, clusters }); const res = await this.guardState(axios.get(url)); if (!res) return null; - this.setImageInfo(res.data); + + // set image info + this.baseInfo = res.data; + this.fileid = this.baseInfo.fileid; + this.filename = this.baseInfo.basename; + this.exif = this.baseInfo.exif ?? {}; return this.baseInfo; }, @@ -449,13 +443,6 @@ export default defineComponent({ _m.modals.editMetadata([_m.viewer.currentPhoto!], [4]); }, - setImageInfo(info: IImageInfo) { - this.fileid = info.fileid; - this.filename = info.basename; - this.exif = info.exif ?? {}; - this.baseInfo = info; - }, - handleFileUpdated({ fileid }: utils.BusEvent['files:file:updated']) { if (fileid && this.fileid === fileid) { this.refresh();