# Phase 6: Support Albums Without Public Links **Status:** ⬜ Not Started **Parent plan:** [PLAN.md](./PLAN.md) **Domain:** backend ## Objective Allow tracking albums even without public links. Templates should conditionally wrap items in `` when public URLs exist, otherwise show plain text names. Telegram should still send assets to chats regardless of public link status. ## Tasks - [ ] Task 1: In template context building (context.py), include `has_public_url` / `album_url` / per-asset `public_url` flags so templates can conditionally render links - [ ] Task 2: Update default system templates (EN/RU seeds) to use `{% if album_url %}` / `{% if asset.public_url %}` conditionals — wrap in `` when URL exists, plain text otherwise - [ ] Task 3: Verify that Telegram notification sending (notifier.py + telegram client) sends assets via direct API download regardless of public link status (it should already work since it uses internal API URLs with api_key headers, not public links) - [ ] Task 4: Ensure the template context correctly distinguishes between internal API URLs (for media download) and public URLs (for user-facing links in messages) - [ ] Task 5: Test that events from albums without public links still generate notifications with asset media but no clickable links in the message text ## Files to Modify/Create - `packages/core/src/notify_bridge_core/templates/context.py` — add public_url flags to context - `packages/core/src/notify_bridge_core/providers/immich/provider.py` — ensure shared link info flows through events - `packages/server/src/notify_bridge_server/services/notifier.py` — verify asset sending works without public links - Default template seeds (wherever EN/RU templates are defined) — conditional link rendering ## Acceptance Criteria - Albums without public links can be tracked without errors - Notifications are sent with media assets regardless of public link status - Message text includes clickable links only when public URLs exist - Message text shows plain album/asset names when no public URL - Default EN/RU templates handle both cases - No regressions for albums that DO have public links ## Notes - Internal asset URLs use format: `{provider_url}/api/assets/{id}/original` with x-api-key header - Public URLs use format: `{external_domain}/share/{key}` (no auth needed) - Telegram client downloads via internal URLs (with headers) — this is independent of public links - The public URL is only relevant for the message text (human-readable links) - Template context already has `album_url` from event.extra — need to make it None/empty when no shared link ## Review Checklist - [ ] All tasks completed - [ ] Code follows project conventions - [ ] No unintended side effects - [ ] Build passes - [ ] Tests pass (new + existing) ## Handoff to Next Phase