From f36799ed69033477d17f5ba2419356ec4b1b5376 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 14 Jun 2026 18:42:55 +0200 Subject: [PATCH] feat(header): clarify video counts and hide idle pause button Show 'N yours / M total' in the header (your subscriptions vs. the whole shared catalog) with a tooltip, backed by a new total_videos field on /sync/my-status. The admin pause button now only appears when there's sync work to pause; Resume still shows whenever sync is paused. --- backend/app/routes/sync.py | 4 ++++ frontend/src/components/SyncStatus.tsx | 16 +++++++++++++--- frontend/src/lib/api.ts | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/backend/app/routes/sync.py b/backend/app/routes/sync.py index ce2d155..2af709e 100644 --- a/backend/app/routes/sync.py +++ b/backend/app/routes/sync.py @@ -152,6 +152,9 @@ def my_status( ), ) ) + # Whole-catalog total (every video any user's subscriptions have pulled in), so the + # header can show "yours" against the shared library size. + total_videos = db.scalar(select(func.count(Video.id))) return { "channels_total": total, "channels_details_synced": details_synced, @@ -163,6 +166,7 @@ def my_status( "deep_pending_count": deep_eta["channels_pending"], "deep_eta_seconds": deep_eta["eta_seconds"], "my_videos": my_videos or 0, + "total_videos": total_videos or 0, "quota_used_today": quota.units_used_today(db), "quota_remaining_today": quota.remaining_today(db), "paused": state.is_sync_paused(db), diff --git a/frontend/src/components/SyncStatus.tsx b/frontend/src/components/SyncStatus.tsx index a07c65d..5e463b6 100644 --- a/frontend/src/components/SyncStatus.tsx +++ b/frontend/src/components/SyncStatus.tsx @@ -34,8 +34,16 @@ export default function SyncStatus({ return (
- - {formatViews(data.my_videos)} videos + + + + + {formatViews(data.my_videos)} yours + + / + {formatViews(data.total_videos)} total + + ยท {data.paused ? ( paused @@ -61,7 +69,9 @@ export default function SyncStatus({ )} - {isAdmin && ( + {/* Pause only makes sense when there's work to pause; Resume must always show + while paused so it can be lifted. Hidden entirely when idle and not paused. */} + {isAdmin && (data.paused || syncing > 0) && (