diff --git a/packages/core/src/notify_bridge_core/templates/command_defaults/en/status.jinja2 b/packages/core/src/notify_bridge_core/templates/command_defaults/en/status.jinja2 index 49edad2..b15d31c 100644 --- a/packages/core/src/notify_bridge_core/templates/command_defaults/en/status.jinja2 +++ b/packages/core/src/notify_bridge_core/templates/command_defaults/en/status.jinja2 @@ -1,4 +1,3 @@ 📊 Status -Trackers: {{ trackers_active }}/{{ trackers_total }} active Albums: {{ total_albums }} -Last event: {{ last_event }} \ No newline at end of file +Last event: {{ last_event }} diff --git a/packages/core/src/notify_bridge_core/templates/command_defaults/ru/status.jinja2 b/packages/core/src/notify_bridge_core/templates/command_defaults/ru/status.jinja2 index 05fff82..873a20b 100644 --- a/packages/core/src/notify_bridge_core/templates/command_defaults/ru/status.jinja2 +++ b/packages/core/src/notify_bridge_core/templates/command_defaults/ru/status.jinja2 @@ -1,4 +1,3 @@ 📊 Статус -Трекеры: {{ trackers_active }}/{{ trackers_total }} активных Альбомы: {{ total_albums }} -Последнее событие: {{ last_event }} \ No newline at end of file +Последнее событие: {{ last_event }} diff --git a/packages/server/src/notify_bridge_server/api/command_template_configs.py b/packages/server/src/notify_bridge_server/api/command_template_configs.py index 0a3a78f..5e1f64d 100644 --- a/packages/server/src/notify_bridge_server/api/command_template_configs.py +++ b/packages/server/src/notify_bridge_server/api/command_template_configs.py @@ -138,13 +138,11 @@ async def get_command_variables( # --- Immich-specific --- immich = { "status": { - "description": "/status tracker summary", + "description": "/status tracker summary (scoped to this chat)", "variables": { **common_vars, - "trackers_active": "Number of active trackers", - "trackers_total": "Total tracker count", - "total_albums": "Total tracked albums", - "last_event": "Last event timestamp string", + "total_albums": "Tracked albums visible to this chat", + "last_event": "Last event timestamp string (scoped to this chat's albums)", }, }, "albums": { diff --git a/packages/server/src/notify_bridge_server/commands/immich/handler.py b/packages/server/src/notify_bridge_server/commands/immich/handler.py index dfb246e..6724474 100644 --- a/packages/server/src/notify_bridge_server/commands/immich/handler.py +++ b/packages/server/src/notify_bridge_server/commands/immich/handler.py @@ -29,8 +29,6 @@ async def _cmd_status( allowed_album_ids: set[str] | None = None, ) -> dict[str, Any]: trackers = await get_trackers_for_provider(provider.id) - active = sum(1 for t in trackers if t.enabled) - total = len(trackers) # Count only albums visible to this chat. Without the scope filter, # /status in a restricted chat leaks the full album count across the @@ -41,13 +39,17 @@ async def _cmd_status( if allowed_album_ids is None or aid in allowed_album_ids: total_albums += 1 + # Last-event timestamp is already scoped — see get_last_event_str, which + # filters EventLog by collection_id against allowed_album_ids. tracker_ids = [t.id for t in trackers] last_str = await get_last_event_str( tracker_ids, allowed_album_ids=allowed_album_ids, ) + # Tracker counts (``trackers_active`` / ``trackers_total``) are a + # per-provider aggregate — they'd leak info about trackers this chat + # has no visibility into once we've scoped everything else. Omitted. return { - "trackers_active": active, "trackers_total": total, "total_albums": total_albums, "last_event": last_str, }