This commit is contained in:
+1
-1
@@ -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}"}
|
||||
|
||||
# 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():
|
||||
return {"success": False, "message": f"Season directory not found: {season_dir}"}
|
||||
|
||||
|
||||
+1
-1
@@ -1796,7 +1796,7 @@ async def bulk_update_nfo_files(dependencies: dict, imdb_ids: list = None, fix_a
|
||||
for ep in episodes:
|
||||
try:
|
||||
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():
|
||||
continue
|
||||
|
||||
@@ -173,6 +173,12 @@ class NFOGuardConfig:
|
||||
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()
|
||||
|
||||
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:
|
||||
"""Load web interface authentication settings"""
|
||||
self.web_auth_enabled = _bool_env("WEB_AUTH_ENABLED", False)
|
||||
|
||||
@@ -194,7 +194,7 @@ class TVProcessor:
|
||||
|
||||
# Create 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(
|
||||
season_dir,
|
||||
season, episode, aired, dateadded, source, config.lock_metadata
|
||||
@@ -264,7 +264,7 @@ class TVProcessor:
|
||||
|
||||
for (season, episode) in episodes_needing_nfo_check:
|
||||
# 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)]
|
||||
|
||||
nfo_found = False
|
||||
@@ -656,7 +656,7 @@ class TVProcessor:
|
||||
|
||||
for (season, episode), (aired, dateadded, source) in episode_dates.items():
|
||||
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
|
||||
if config.manage_nfo:
|
||||
@@ -789,7 +789,7 @@ class TVProcessor:
|
||||
continue
|
||||
|
||||
# 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():
|
||||
_log("WARNING", f"Season directory not found: {season_dir}")
|
||||
continue
|
||||
@@ -842,7 +842,7 @@ class TVProcessor:
|
||||
# for webhook_episode in webhook_episodes:
|
||||
# season_num = webhook_episode.get("seasonNumber")
|
||||
# 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():
|
||||
# self.nfo_manager.create_season_nfo(season_dir, season_num)
|
||||
# seasons_processed.add(season_num)
|
||||
@@ -1084,7 +1084,7 @@ class TVProcessor:
|
||||
# Create NFO if needed
|
||||
nfo_success = True
|
||||
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(
|
||||
season_dir, season, episode, aired, dateadded, "webhook", config.lock_metadata
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user