From b5586d3f28a7f96841ff1d16be868c834adb2d7a Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Wed, 17 Jun 2026 13:05:25 -0700 Subject: [PATCH] YouTube: enrich dates on ANY channel page open (not just followed) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug from the logs: opening MrBeast showed only '2026: 3, Earlier: 87' because the InnerTube date enrichment only fired for FOLLOWED channels — MrBeast was opened, not followed, so it never ran and the page had only RSS dates (and RSS includes Shorts that don't match the Videos tab → ~3 real matches). Now opening any channel page enqueues enrichment, so its full catalog gets dated in the background and the years populate via the existing re-poll. (24h gate still prevents re-sweeping; the enqueue still no-ops under tests.) --- api/video/youtube.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/api/video/youtube.py b/api/video/youtube.py index dfab7244..6be64b47 100644 --- a/api/video/youtube.py +++ b/api/video/youtube.py @@ -164,12 +164,13 @@ def register_routes(bp): return jsonify({"success": False, "error": "Channel not found"}), 404 cid = channel["youtube_id"] following = bool(db.channel_watch_state([cid])) - if following: # opening a followed channel → ensure its dates get enriched - try: - from core.video.youtube_enrichment import get_youtube_date_enricher - get_youtube_date_enricher().enqueue(cid, channel.get("title")) - except Exception: - pass + # Opening a channel page → enrich its upload dates in the background + # (followed or not — you're looking at it, so you want the years). + try: + from core.video.youtube_enrichment import get_youtube_date_enricher + get_youtube_date_enricher().enqueue(cid, channel.get("title")) + except Exception: + pass # backfill the real avatar onto wished rows (flat listing often omits it) if channel.get("avatar_url"): try: