diff --git a/music-lab/app/db.py b/music-lab/app/db.py index de3462d..744d463 100644 --- a/music-lab/app/db.py +++ b/music-lab/app/db.py @@ -1030,6 +1030,15 @@ def _parse_pipeline_row(row: sqlite3.Row) -> Dict[str, Any]: d["metadata"] = json.loads(d["metadata_json"]) if d.get("review_json"): d["review"] = json.loads(d["review_json"]) + + # Cache-bust media URLs — append ?v={updated_at_compact} so browsers/telegram fetch fresh after regen + updated_at = d.get("updated_at", "") or "" + if updated_at: + cache_key = updated_at.replace(":", "").replace("-", "").replace("T", "").replace(".", "") + for url_key in ("cover_url", "video_url", "thumbnail_url"): + url = d.get(url_key) + if url and "?" not in url: + d[url_key] = f"{url}?v={cache_key}" return d