From cb11ffdd2d68e936f608bb4390886bf45635e8d0 Mon Sep 17 00:00:00 2001 From: Thomas Faour Date: Fri, 24 Jul 2026 14:39:01 -0400 Subject: [PATCH] Fix Load Albums button in the photos widget dialog The dialog calls /albums via window.FRAME_API, but that's repointed to this widget's own API base while a dialog is open (see frame_layout.js) -- /albums is frame-level (lists the owner's whole Immich library, not scoped to one photo widget), so it needs window.FRAME_BASE_API instead. The button silently 404'd since the resulting URL never existed. --- server/app/static/widget_dialog_photos.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/app/static/widget_dialog_photos.js b/server/app/static/widget_dialog_photos.js index 81f6aae..39fc778 100644 --- a/server/app/static/widget_dialog_photos.js +++ b/server/app/static/widget_dialog_photos.js @@ -73,7 +73,12 @@ async function savePhotoSettings() { function initPhotosDialog() { document.getElementById('load-albums').addEventListener('click', async () => { try { - const resp = await fetch(`${window.FRAME_API}/albums`); + // /albums is frame-level (routers/api_frames.py) -- it lists the + // frame owner's whole Immich library, not something scoped to + // this one photo widget -- so it uses window.FRAME_BASE_API (the + // stable frame-level base), not window.FRAME_API (repointed to + // this widget's own API base while the dialog is open). + const resp = await fetch(`${window.FRAME_BASE_API}/albums`); if (!resp.ok) { throw new Error(await apiError(resp)); }