fix: Remove nfo_migration_required source and ensure proper date lookup
Local Docker Build (Dev) / build-dev (push) Successful in 49s
Local Docker Build (Dev) / build-dev (push) Successful in 49s
- 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
This commit is contained in:
+12
-6
@@ -449,20 +449,26 @@ class TVProcessor:
|
|||||||
existing_nfo = self.nfo_manager.find_existing_episode_nfo(season_dir, season_num, episode_num)
|
existing_nfo = self.nfo_manager.find_existing_episode_nfo(season_dir, season_num, episode_num)
|
||||||
|
|
||||||
if existing_nfo:
|
if existing_nfo:
|
||||||
# Force processing of this episode for NFO migration
|
# Force processing of this episode to ensure proper dates
|
||||||
episode_dates[(season_num, episode_num)] = (None, None, "nfo_migration_required")
|
|
||||||
nfo_episodes_found += 1
|
nfo_episodes_found += 1
|
||||||
|
|
||||||
if nfo_episodes_found > 0:
|
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())
|
cached_keys = set(episode_dates.keys())
|
||||||
missing_keys = set(disk_episodes.keys()) - cached_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 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
|
return episode_dates
|
||||||
|
|
||||||
_log("INFO", f"Querying APIs for {len(missing_keys)} missing episodes")
|
_log("INFO", f"Querying APIs for {len(missing_keys)} missing episodes")
|
||||||
|
|||||||
Reference in New Issue
Block a user