Video auto-wishlist: carry episode synopsis + still into the wishlist

Auto-added airing episodes came in metadata-empty (no synopsis, no still) — the
handler only passed season/episode/title/air_date, dropping the overview the
calendar already returns and never fetching the still URL (calendar_upcoming
only returned a has_still flag, not the URL). Now calendar_upcoming also returns
e.still_url, and the handler carries overview + still_url through. The wishlist
renders the (Plex-relative) still via the same pimg() proxy as the show poster,
so it resolves. Idempotent upsert backfills the already-added empty rows on the
next run.
video
BoulderBadgeDad 1 week ago
parent fd66390648
commit cc2fb2ff79

@ -70,6 +70,10 @@ def auto_video_add_airing_episodes(
'episode_number': r.get('episode_number'),
'title': r.get('title'),
'air_date': r.get('air_date'),
# carry the rich metadata so auto-added episodes look like manual ones
# (synopsis + still thumbnail), not blank rows
'overview': r.get('overview'),
'still_url': r.get('still_url'),
})
added = 0

@ -1723,7 +1723,7 @@ class VideoDatabase:
rows = conn.execute(
"SELECT e.id, e.show_id, e.season_number, e.episode_number, e.title, "
"e.overview, e.air_date, e.runtime_minutes, e.rating, e.has_file, e.monitored, "
"(e.still_url IS NOT NULL AND e.still_url<>'') AS has_still, "
"e.still_url, (e.still_url IS NOT NULL AND e.still_url<>'') AS has_still, "
"s.tmdb_id AS show_tmdb_id, "
"s.title AS show_title, s.network, s.airs_time, s.year AS show_year, s.status AS show_status, "
"(s.poster_url IS NOT NULL AND s.poster_url<>'') AS show_has_poster, "

@ -43,6 +43,25 @@ def test_adds_unowned_airings_grouped_by_show():
assert (1, "Widows Bay", 2) in added and (2, "Another Show", 1) in added
def test_episode_synopsis_and_still_are_carried_to_the_wishlist():
# auto-added episodes must look like manual ones — synopsis + still, not blank
rows = [{"show_tmdb_id": 1, "show_title": "X", "season_number": 1, "episode_number": 2,
"title": "Ep", "air_date": "2026-06-21", "has_file": False,
"overview": "A synopsis.", "still_url": "/library/metadata/9/thumb/1"}]
captured = {}
def add(tid, title, eps):
captured["eps"] = eps
return len(eps)
auto_video_add_airing_episodes({"_automation_id": "a"}, _Deps(),
fetch_airing=lambda t: rows, add_episodes=add,
today_fn=lambda: "2026-06-21")
ep = captured["eps"][0]
assert ep["overview"] == "A synopsis."
assert ep["still_url"] == "/library/metadata/9/thumb/1"
def test_queries_the_calendar_for_today():
seen = {}

Loading…
Cancel
Save