diff --git a/backend/app/routes/channels.py b/backend/app/routes/channels.py index d458670..b99bac7 100644 --- a/backend/app/routes/channels.py +++ b/backend/app/routes/channels.py @@ -36,6 +36,22 @@ def list_channels( ).all(): stored[cid] = count + # Channels already in the *global* deep-backfill queue — i.e. at least one user (any + # user) has requested full history and it isn't done yet. Their whole back-catalogue is + # coming for everyone (video data is shared), so the UI shouldn't offer "get full + # history" to a user who simply hasn't personally opted in. + deep_queued: set[str] = set() + if channel_ids: + for (cid,) in db.execute( + select(Subscription.channel_id) + .where( + Subscription.channel_id.in_(channel_ids), + Subscription.deep_requested.is_(True), + ) + .distinct() + ).all(): + deep_queued.add(cid) + # The user's personal tag links, grouped by channel. tags_by_channel: dict[str, list[int]] = {} for cid, tag_id in db.execute( @@ -57,6 +73,7 @@ def list_channels( "priority": sub.priority, "hidden": sub.hidden, "deep_requested": sub.deep_requested, + "deep_in_queue": ch.id in deep_queued and not ch.backfill_done, "tag_ids": tags_by_channel.get(ch.id, []), "details_synced": ch.details_synced_at is not None, "recent_synced": ch.recent_synced_at is not None, diff --git a/frontend/src/components/Channels.tsx b/frontend/src/components/Channels.tsx index d27bba0..ea073b6 100644 --- a/frontend/src/components/Channels.tsx +++ b/frontend/src/components/Channels.tsx @@ -354,24 +354,31 @@ function ChannelRow({ /> {c.backfill_done ? ( - ) : ( - + ) : c.deep_requested ? ( + + + ) : c.deep_in_queue ? ( + + + + full history queued + + + ) : ( + + )} diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index cf50bcb..bf693dd 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -176,6 +176,7 @@ export interface ManagedChannel { priority: number; hidden: boolean; deep_requested: boolean; + deep_in_queue: boolean; tag_ids: number[]; details_synced: boolean; recent_synced: boolean;