diff --git a/backend/app/sync/videos.py b/backend/app/sync/videos.py index d9c9f8b..89d6865 100644 --- a/backend/app/sync/videos.py +++ b/backend/app/sync/videos.py @@ -54,6 +54,11 @@ def _insert_stubs(db: Session, rows: list[dict]) -> int: return 0 seen: dict[str, dict] = {} for row in rows: + # Normalize the title at first insert too (RSS/backfill stubs), so a brand-new video + # never flashes its raw title before enrichment refreshes it. + raw = row.get("title") + if raw: + row = {**row, "original_title": raw, "title": normalize_title(raw)} seen[row["id"]] = row stmt = ( pg_insert(Video)