From 17aec56952a723495c6ecf23e71012e1b151107a Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Sat, 4 Oct 2025 11:08:58 -0400 Subject: [PATCH 1/3] Add missing aiohttp dependency to requirements.txt - Add aiohttp==3.8.6 to fix ModuleNotFoundError in runtime_validator - Container now shows config: manage_nfo=True (confirms NFO creation enabled) - Version bump to 2.0.5 --- VERSION | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2165f8f..e010258 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.4 +2.0.5 diff --git a/requirements.txt b/requirements.txt index 043f2eb..5d8a6f5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ psycopg2-binary==2.9.7 requests==2.31.0 python-multipart==0.0.6 aiofiles==23.2.1 +aiohttp==3.8.6 python-dotenv==1.0.0 From acf741e6bb4394ee8e3d30d7de81617d9dfddf88 Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Sat, 4 Oct 2025 11:12:23 -0400 Subject: [PATCH 2/3] Add missing psutil dependency to complete requirements - Add psutil==5.9.6 for monitoring metrics functionality - Container confirmed: manage_nfo=True (NFO creation enabled) - All external dependencies now included in requirements.txt - Version bump to 2.0.6 for complete dependency resolution --- VERSION | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e010258..157e54f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.5 +2.0.6 diff --git a/requirements.txt b/requirements.txt index 5d8a6f5..bc54ab1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ requests==2.31.0 python-multipart==0.0.6 aiofiles==23.2.1 aiohttp==3.8.6 +psutil==5.9.6 python-dotenv==1.0.0 From 0980ba076121561e039023bae31f3c61d219efee Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Sat, 4 Oct 2025 11:41:35 -0400 Subject: [PATCH 3/3] Fix TV processing issues: correct method names and add missing episode air date method - Fix SonarrClient method call from get_series_by_imdb to series_by_imdb - Fix SonarrClient method call from get_episodes to episodes_for_series - Add missing get_episode_air_date method to ExternalClientManager - Method uses TMDB and OMDb APIs to fetch episode air dates - Version bump to 2.0.7 --- VERSION | 2 +- clients/external_clients.py | 30 ++++++++++++++++++++++++++++++ processors/tv_processor.py | 4 ++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 157e54f..f1547e6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.6 +2.0.7 diff --git a/clients/external_clients.py b/clients/external_clients.py index 4c15520..07a750a 100644 --- a/clients/external_clients.py +++ b/clients/external_clients.py @@ -659,6 +659,36 @@ class ExternalClientManager: return None return self.tvdb.imdb_to_tvdb_series_id(imdb_id) + + def get_episode_air_date(self, imdb_id: str, season: int, episode: int) -> Optional[str]: + """Get episode air date from external sources""" + _log("DEBUG", f"Looking for air date for {imdb_id} S{season:02d}E{episode:02d}") + + # Try TMDB first if available + if self.tmdb.enabled: + # Find TV show by IMDB ID + tv_find_result = self.tmdb._get(f"/find/{imdb_id}", {"external_source": "imdb_id"}) + if tv_find_result and tv_find_result.get("tv_results"): + tv_show = tv_find_result["tv_results"][0] + tv_id = tv_show.get("id") + if tv_id: + _log("DEBUG", f"Found TMDB TV ID {tv_id} for {imdb_id}") + episodes = self.tmdb.get_tv_season_episodes(tv_id, season) + if episode in episodes: + air_date = episodes[episode] + _log("INFO", f"Found TMDB air date for {imdb_id} S{season:02d}E{episode:02d}: {air_date}") + return _parse_date_to_iso(air_date) + + # Try OMDb as fallback + if self.omdb.enabled: + episodes = self.omdb.get_tv_season_episodes(imdb_id, season) + if episode in episodes: + air_date = episodes[episode] + _log("INFO", f"Found OMDb air date for {imdb_id} S{season:02d}E{episode:02d}: {air_date}") + return _parse_date_to_iso(air_date) + + _log("WARNING", f"No air date found for {imdb_id} S{season:02d}E{episode:02d}") + return None if __name__ == "__main__": diff --git a/processors/tv_processor.py b/processors/tv_processor.py index ed351ae..88eb992 100644 --- a/processors/tv_processor.py +++ b/processors/tv_processor.py @@ -142,7 +142,7 @@ class TVProcessor: def _get_sonarr_episodes(self, imdb_id: str) -> Dict[Tuple[int, int], Dict[str, Any]]: """Get episode information from Sonarr""" try: - series_data = self.sonarr.get_series_by_imdb(imdb_id) + series_data = self.sonarr.series_by_imdb(imdb_id) if not series_data: return {} @@ -150,7 +150,7 @@ class TVProcessor: if not series_id: return {} - episodes = self.sonarr.get_episodes(series_id) + episodes = self.sonarr.episodes_for_series(series_id) episode_map = {} for episode in episodes: