update: to handle specials
Local Docker Build (Dev) / build-dev (push) Successful in 7s

This commit is contained in:
2025-10-28 17:00:56 -04:00
parent babe5ac0df
commit b709a377c8
4 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -2198,7 +2198,7 @@ async def update_episode_nfo(imdb_id: str, season: int, episode: int, request: R
return {"success": False, "message": f"Series directory not found for {imdb_id}"} return {"success": False, "message": f"Series directory not found for {imdb_id}"}
# Get season directory # Get season directory
season_dir = series_path / config.tv_season_dir_format.format(season=season) season_dir = series_path / config.get_season_dir_name(season)
if not season_dir.exists(): if not season_dir.exists():
return {"success": False, "message": f"Season directory not found: {season_dir}"} return {"success": False, "message": f"Season directory not found: {season_dir}"}
+1 -1
View File
@@ -1796,7 +1796,7 @@ async def bulk_update_nfo_files(dependencies: dict, imdb_ids: list = None, fix_a
for ep in episodes: for ep in episodes:
try: try:
series_path = Path(ep['series_path']) series_path = Path(ep['series_path'])
season_dir = series_path / config.tv_season_dir_format.format(season=ep['season']) season_dir = series_path / config.get_season_dir_name(ep['season'])
if not season_dir.exists(): if not season_dir.exists():
continue continue
+6
View File
@@ -173,6 +173,12 @@ class NFOGuardConfig:
self.tv_season_dir_pattern = os.environ.get("TV_SEASON_DIR_PATTERN", "season ").lower() self.tv_season_dir_pattern = os.environ.get("TV_SEASON_DIR_PATTERN", "season ").lower()
self.tv_webhook_processing_mode = os.environ.get("TV_WEBHOOK_PROCESSING_MODE", "targeted").lower() self.tv_webhook_processing_mode = os.environ.get("TV_WEBHOOK_PROCESSING_MODE", "targeted").lower()
def get_season_dir_name(self, season: int) -> str:
"""Get the directory name for a specific season, handling Season 0 as 'Specials'"""
if season == 0:
return "Specials"
return self.tv_season_dir_format.format(season=season)
def _load_auth_settings(self) -> None: def _load_auth_settings(self) -> None:
"""Load web interface authentication settings""" """Load web interface authentication settings"""
self.web_auth_enabled = _bool_env("WEB_AUTH_ENABLED", False) self.web_auth_enabled = _bool_env("WEB_AUTH_ENABLED", False)
+6 -6
View File
@@ -194,7 +194,7 @@ class TVProcessor:
# Create NFO # Create NFO
if config.manage_nfo: if config.manage_nfo:
season_dir = series_path / config.tv_season_dir_format.format(season=season) season_dir = series_path / config.get_season_dir_name(season)
self.nfo_manager.create_episode_nfo( self.nfo_manager.create_episode_nfo(
season_dir, season_dir,
season, episode, aired, dateadded, source, config.lock_metadata season, episode, aired, dateadded, source, config.lock_metadata
@@ -264,7 +264,7 @@ class TVProcessor:
for (season, episode) in episodes_needing_nfo_check: for (season, episode) in episodes_needing_nfo_check:
# Look for existing NFO files for this episode # Look for existing NFO files for this episode
season_dir = series_path / config.tv_season_dir_format.format(season=season) season_dir = series_path / config.get_season_dir_name(season)
episode_files = disk_episodes[(season, episode)] episode_files = disk_episodes[(season, episode)]
nfo_found = False nfo_found = False
@@ -656,7 +656,7 @@ class TVProcessor:
for (season, episode), (aired, dateadded, source) in episode_dates.items(): for (season, episode), (aired, dateadded, source) in episode_dates.items():
if (season, episode) in disk_episodes: if (season, episode) in disk_episodes:
season_dir = series_path / config.tv_season_dir_format.format(season=season) season_dir = series_path / config.get_season_dir_name(season)
# Prepare NFO creation data # Prepare NFO creation data
if config.manage_nfo: if config.manage_nfo:
@@ -789,7 +789,7 @@ class TVProcessor:
continue continue
# Check if episode file exists on disk # Check if episode file exists on disk
season_dir = series_path / config.tv_season_dir_format.format(season=season_num) season_dir = series_path / config.get_season_dir_name(season_num)
if not season_dir.exists(): if not season_dir.exists():
_log("WARNING", f"Season directory not found: {season_dir}") _log("WARNING", f"Season directory not found: {season_dir}")
continue continue
@@ -842,7 +842,7 @@ class TVProcessor:
# for webhook_episode in webhook_episodes: # for webhook_episode in webhook_episodes:
# season_num = webhook_episode.get("seasonNumber") # season_num = webhook_episode.get("seasonNumber")
# if season_num and season_num not in seasons_processed: # if season_num and season_num not in seasons_processed:
# season_dir = series_path / config.tv_season_dir_format.format(season=season_num) # season_dir = series_path / config.get_season_dir_name(season_num)
# if season_dir.exists(): # if season_dir.exists():
# self.nfo_manager.create_season_nfo(season_dir, season_num) # self.nfo_manager.create_season_nfo(season_dir, season_num)
# seasons_processed.add(season_num) # seasons_processed.add(season_num)
@@ -1084,7 +1084,7 @@ class TVProcessor:
# Create NFO if needed # Create NFO if needed
nfo_success = True nfo_success = True
if config.manage_nfo: if config.manage_nfo:
season_dir = series_path / config.tv_season_dir_format.format(season=season) season_dir = series_path / config.get_season_dir_name(season)
nfo_success = await self.async_nfo_manager.async_create_episode_nfo( nfo_success = await self.async_nfo_manager.async_create_episode_nfo(
season_dir, season, episode, aired, dateadded, "webhook", config.lock_metadata season_dir, season, episode, aired, dateadded, "webhook", config.lock_metadata
) )