From dc648a496340eccfd426cbf97002438415e14f18 Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Fri, 26 Sep 2025 09:09:58 -0400 Subject: [PATCH] fix: Stop touching season.nfo/tvshow.nfo and debug missing NFO metadata Changes: - Disabled creation/updating of season.nfo and tvshow.nfo files NFOGuard should only manage episode NFO files, not series-level files - Added debugging output to track aired/dateadded values in NFO updates The example NFO was missing these crucial fields despite processing Debug logs will show if data is being passed correctly to update function This ensures NFOGuard only manages episode-level metadata files and helps identify why some NFO files are missing the dateadded/aired fields. --- VERSION | 2 +- core/nfo_manager.py | 7 +++++++ processors/tv_processor.py | 14 +++----------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/VERSION b/VERSION index 158c747..7bc1c40 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9.5 +1.9.6 diff --git a/core/nfo_manager.py b/core/nfo_manager.py index 2c89215..3882359 100644 --- a/core/nfo_manager.py +++ b/core/nfo_manager.py @@ -988,13 +988,20 @@ class NFOManager: episode_elem.text = str(episode_num) # Dates at the end + print(f"🔍 NFO Update Debug - aired: '{aired}', dateadded: '{dateadded}'") if aired: aired_elem = ET.SubElement(episode, "aired") aired_elem.text = aired[:10] if len(aired) >= 10 else aired + print(f"✅ Added aired field: {aired}") + else: + print(f"⚠️ No aired date provided") if dateadded: dateadded_elem = ET.SubElement(episode, "dateadded") dateadded_elem.text = dateadded + print(f"✅ Added dateadded field: {dateadded}") + else: + print(f"⚠️ No dateadded provided") # Add NFOGuard comment at the bottom with other NFOGuard fields nfoguard_comment = ET.Comment(f" Updated by {self.manager_brand} - Source: {source} ") diff --git a/processors/tv_processor.py b/processors/tv_processor.py index 5789af8..1d50eff 100644 --- a/processors/tv_processor.py +++ b/processors/tv_processor.py @@ -122,18 +122,10 @@ class TVProcessor: # Save to database self.db.upsert_episode_date(imdb_id, season, episode, aired, dateadded, source, True) - # Create season/tvshow NFOs + # Skip season/tvshow NFO creation - only manage episode NFOs + # (season.nfo and tvshow.nfo should be left untouched) if config.manage_nfo: - seasons_processed = set() - for (season, episode) in disk_episodes.keys(): - if season not in seasons_processed: - season_dir = series_path / config.tv_season_dir_format.format(season=season) - self.nfo_manager.create_season_nfo(season_dir, season) - seasons_processed.add(season) - - # Get TVDB ID for better Emby compatibility - tvdb_id = self.external_clients.get_tvdb_series_id(imdb_id) - self.nfo_manager.create_tvshow_nfo(series_path, imdb_id, tvdb_id) + _log("DEBUG", "Skipping season.nfo and tvshow.nfo creation - only managing episode NFOs") _log("INFO", f"Completed processing TV series: {series_path.name}")