From 9b0da8b6ed83b3c22c8fc08e92725e5bb06c94d0 Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Fri, 26 Sep 2025 10:11:52 -0400 Subject: [PATCH] fix: Remove nfo_migration_required source and ensure proper date lookup - Remove bogus 'nfo_migration_required' source that bypassed proper date lookup - Ensure episodes with existing NFOs still get processed through Sonarr API - Episodes should get proper dateadded from Sonarr import history or airdate fallback - Version bump to 1.9.3-longnames --- VERSION | 2 +- nfoguard.py | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 14cd8ed..71f8d22 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9.2-longnames +1.9.3-longnames diff --git a/nfoguard.py b/nfoguard.py index f29275c..2e98d0b 100644 --- a/nfoguard.py +++ b/nfoguard.py @@ -449,20 +449,26 @@ class TVProcessor: existing_nfo = self.nfo_manager.find_existing_episode_nfo(season_dir, season_num, episode_num) if existing_nfo: - # Force processing of this episode for NFO migration - episode_dates[(season_num, episode_num)] = (None, None, "nfo_migration_required") + # Force processing of this episode to ensure proper dates nfo_episodes_found += 1 if nfo_episodes_found > 0: - _log("INFO", f"Found {nfo_episodes_found} episodes with existing NFO files requiring migration") + _log("INFO", f"Found {nfo_episodes_found} episodes with existing NFO files") - # Find missing episodes (not in cache and no existing NFO) + # Find missing episodes (not in cache) cached_keys = set(episode_dates.keys()) missing_keys = set(disk_episodes.keys()) - cached_keys + # Add episodes with existing NFOs to missing_keys so they get proper date lookup + for season_num, episode_num in disk_episodes.keys(): + if (season_num, episode_num) not in cached_keys: + season_dir = series_path / config.tv_season_dir_format.format(season=season_num) + existing_nfo = self.nfo_manager.find_existing_episode_nfo(season_dir, season_num, episode_num) + if existing_nfo: + missing_keys.add((season_num, episode_num)) + if not missing_keys: - if nfo_episodes_found == 0: - _log("INFO", "All episodes found in cache") + _log("INFO", "All episodes found in cache") return episode_dates _log("INFO", f"Querying APIs for {len(missing_keys)} missing episodes")