From 2a1f8fd97d7db79db8614fc6e5bdce572c047fd4 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 23 Jan 2026 21:17:13 -0700 Subject: [PATCH] Add a hook into the image app that broadcasts when an image is uploaded/updated --- module/apps/Image.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/apps/Image.mjs b/module/apps/Image.mjs index 1a5c38f..2e9f4da 100644 --- a/module/apps/Image.mjs +++ b/module/apps/Image.mjs @@ -114,6 +114,8 @@ export class ImageApp extends path: this.#file ? path : ``, }; await uploadJson(`db`, `images.json`, images); + + Hooks.callAll(`${__ID__}.imageUploaded`, hash, images[hash]); } else { const images = await getFile(this.constructor.dbPath); @@ -123,6 +125,8 @@ export class ImageApp extends artists: data.artists, }); await uploadJson(`db`, `images.json`, images); + + Hooks.callAll(`${__ID__}.imageUpdated`, this._docID, images[this._docID]); }; }; // #endregion Lifecycle