feat(commands): drop tracker counts from /status
trackers_active / trackers_total are per-provider aggregates — once the rest of /status is scoped to the chat's album set (total_albums and last_event both filtered by the derived scope), leaving tracker counts in would leak info about trackers this chat has no visibility into. - _cmd_status no longer emits trackers_active / trackers_total. - Immich default status templates (en, ru) just show Albums + Last event. - Variable catalog updated so the template editor stops suggesting the removed vars for the Immich /status slot.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
📊 Status
|
||||
Trackers: {{ trackers_active }}/{{ trackers_total }} active
|
||||
Albums: {{ total_albums }}
|
||||
Last event: {{ last_event }}
|
||||
Last event: {{ last_event }}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
📊 Статус
|
||||
Трекеры: {{ trackers_active }}/{{ trackers_total }} активных
|
||||
Альбомы: {{ total_albums }}
|
||||
Последнее событие: {{ last_event }}
|
||||
Последнее событие: {{ last_event }}
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user