metadata: revert quick learning

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/900/head
Varun Patil 2023-10-29 12:17:00 -07:00
parent 54059b4216
commit 42f32350d9
1 changed files with 6 additions and 19 deletions

View File

@ -391,17 +391,6 @@ export default defineComponent({
this.fileid = null; this.fileid = null;
this.exif = {}; 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 // which clusters to get
const clusters = this.routeIsPublic const clusters = this.routeIsPublic
? String() ? String()
@ -420,7 +409,12 @@ export default defineComponent({
const url = API.Q(utils.getImageInfoUrl(photo), { tags, clusters }); const url = API.Q(utils.getImageInfoUrl(photo), { tags, clusters });
const res = await this.guardState(axios.get<IImageInfo>(url)); const res = await this.guardState(axios.get<IImageInfo>(url));
if (!res) return null; 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; return this.baseInfo;
}, },
@ -449,13 +443,6 @@ export default defineComponent({
_m.modals.editMetadata([_m.viewer.currentPhoto!], [4]); _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']) { handleFileUpdated({ fileid }: utils.BusEvent['files:file:updated']) {
if (fileid && this.fileid === fileid) { if (fileid && this.fileid === fileid) {
this.refresh(); this.refresh();