From aab29e253f8117c41b17cd1d03515136bcf70043 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Thu, 19 Mar 2026 19:02:35 +0300 Subject: [PATCH] Fix [object Object] in Variables button + allow preview of system templates - Escape {{ }} in Svelte template (use {'{{ }}'} string expression) - Allow _get() to access system templates (user_id=0) for preview Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/routes/template-configs/+page.svelte | 2 +- .../server/src/immich_watcher_server/api/template_configs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/routes/template-configs/+page.svelte b/frontend/src/routes/template-configs/+page.svelte index a19faba..ec8f0da 100644 --- a/frontend/src/routes/template-configs/+page.svelte +++ b/frontend/src/routes/template-configs/+page.svelte @@ -133,7 +133,7 @@ {#if varsRef[slot.key]} + class="text-xs text-[var(--color-muted-foreground)] hover:underline">{'{{ }}'} Variables {/if} {#if (slot.rows || 2) > 2} diff --git a/packages/server/src/immich_watcher_server/api/template_configs.py b/packages/server/src/immich_watcher_server/api/template_configs.py index 8383f78..fbb20d5 100644 --- a/packages/server/src/immich_watcher_server/api/template_configs.py +++ b/packages/server/src/immich_watcher_server/api/template_configs.py @@ -165,6 +165,6 @@ def _response(c: TemplateConfig) -> dict: async def _get(session: AsyncSession, config_id: int, user_id: int) -> TemplateConfig: config = await session.get(TemplateConfig, config_id) - if not config or config.user_id != user_id: + if not config or (config.user_id != user_id and config.user_id != 0): raise HTTPException(status_code=404, detail="Template config not found") return config