YouTube: enrich dates on ANY channel page open (not just followed)

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.)
This commit is contained in:
BoulderBadgeDad 2026-06-17 13:05:25 -07:00
parent 59dafff96a
commit b5586d3f28

View file

@ -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: