From cc2fb2ff797adeb90e4aa8be7dea4cf3f8615625 Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Sun, 21 Jun 2026 09:20:27 -0700 Subject: [PATCH] Video auto-wishlist: carry episode synopsis + still into the wishlist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../handlers/video_auto_wishlist_airing.py | 4 ++++ database/video_database.py | 2 +- tests/test_video_auto_wishlist_airing.py | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/core/automation/handlers/video_auto_wishlist_airing.py b/core/automation/handlers/video_auto_wishlist_airing.py index bff0d434..2e1d0cac 100644 --- a/core/automation/handlers/video_auto_wishlist_airing.py +++ b/core/automation/handlers/video_auto_wishlist_airing.py @@ -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 diff --git a/database/video_database.py b/database/video_database.py index dec191f8..029c3f13 100644 --- a/database/video_database.py +++ b/database/video_database.py @@ -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, " diff --git a/tests/test_video_auto_wishlist_airing.py b/tests/test_video_auto_wishlist_airing.py index e32ed54c..c1c18c4c 100644 --- a/tests/test_video_auto_wishlist_airing.py +++ b/tests/test_video_auto_wishlist_airing.py @@ -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 = {}