From 2ee2775bfb33aa685a51191163355ddc05e5a1c5 Mon Sep 17 00:00:00 2001 From: eric Date: Fri, 21 Aug 2026 22:39:47 -0500 Subject: [PATCH] fix(youtube): show channel avatar and YouTube nickname on cards for OAuth matching Co-authored-by: Cursor --- backend/app/youtube_manage.py | 7 +- frontend/src/app/youtube/page.tsx | 40 ++++++++--- frontend/src/components/YtAssignPanel.tsx | 67 ++++++++++--------- .../components/YtChannelProfileSnippet.tsx | 66 +++++++++++++++--- 4 files changed, 124 insertions(+), 56 deletions(-) diff --git a/backend/app/youtube_manage.py b/backend/app/youtube_manage.py index 0659b83..5302031 100644 --- a/backend/app/youtube_manage.py +++ b/backend/app/youtube_manage.py @@ -106,16 +106,21 @@ def list_managed_channels() -> list[dict[str, Any]]: rows = db.list_shorts_channels() out = [] for ch in rows: + sn = _snippet_from_channel_row(ch) or {} out.append( { "id": ch.get("id"), "name": ch.get("name"), - "youtube_channel_id": ch.get("youtube_channel_id"), + "youtube_channel_id": ch.get("youtube_channel_id") or sn.get("youtube_channel_id") or "", "enabled": bool(ch.get("enabled")), "authorized": bool(str(ch.get("refresh_token") or "").strip()), "daily_min": ch.get("daily_min"), "daily_max": ch.get("daily_max"), "privacy": ch.get("privacy"), + "title": sn.get("title") or ch.get("name"), + "custom_url": sn.get("custom_url") or "", + "thumb_url": sn.get("thumb_url") or "", + "yt_profile": sn or None, } ) return out diff --git a/frontend/src/app/youtube/page.tsx b/frontend/src/app/youtube/page.tsx index 2a24d03..cf332bf 100644 --- a/frontend/src/app/youtube/page.tsx +++ b/frontend/src/app/youtube/page.tsx @@ -24,6 +24,7 @@ import { useConfirm } from "@/components/ConfirmDialog"; import { useToast } from "@/components/Toast"; import { YouTubeLiveBadge } from "@/components/YouTubeLiveBadge"; import { YtAssignPanel } from "@/components/YtAssignPanel"; +import { YtChannelProfileSnippet } from "@/components/YtChannelProfileSnippet"; import { fetchJson, fmtTs } from "@/lib/api"; import { shortsLiveRef } from "@/lib/youtubeLive"; @@ -38,6 +39,10 @@ type ManagedChannel = { authorized?: boolean; daily_min?: number; daily_max?: number; + title?: string; + thumb_url?: string; + custom_url?: string; + yt_profile?: any; }; type YtVideo = { @@ -315,18 +320,31 @@ export default function YouTubePage() { ) : ( <> +
+ {channels.map((c) => { + const active = c.id === channelPk; + return ( + + ); + })} +
- {channelPk ? : null}