debug: Add extensive logging for episode detection
Local Docker Build (Dev) / build-dev (push) Successful in 29s
Local Docker Build (Dev) / build-dev (push) Successful in 29s
Added detailed debug logging to diagnose why High Potential shows "0 episodes" despite having video files: - Log season directory detection and pattern matching - Log video file scanning and episode filename parsing - Log season number extraction and matching logic - Log final episode count and processing decisions This will help identify where the episode detection is failing in the pipeline. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -98,20 +98,29 @@ class TVSeriesProcessor:
|
||||
"""Find all episodes on disk, grouped by (season, episode)"""
|
||||
episodes = {}
|
||||
|
||||
_log("DEBUG", f"Scanning for season directories in: {series_path}")
|
||||
for season_dir in series_path.iterdir():
|
||||
_log("DEBUG", f"Checking directory: {season_dir.name} (is_dir: {season_dir.is_dir()})")
|
||||
if season_dir.is_dir() and self._is_season_directory(season_dir.name):
|
||||
season_num = self._extract_season_number(season_dir.name)
|
||||
_log("DEBUG", f"Found season directory: {season_dir.name} → season {season_num}")
|
||||
if season_num is None:
|
||||
continue
|
||||
|
||||
# Find video files in this season
|
||||
season_episodes = self.episode_nfo_manager.find_video_files_for_season(season_dir)
|
||||
_log("DEBUG", f"Found {len(season_episodes)} episodes in {season_dir.name}: {list(season_episodes.keys())}")
|
||||
|
||||
# Add season directory info to episodes
|
||||
for (s_num, e_num), video_files in season_episodes.items():
|
||||
_log("DEBUG", f"Episode S{s_num:02d}E{e_num:02d}: season_dir={season_num}, filename_season={s_num}")
|
||||
if s_num == season_num: # Verify season matches directory
|
||||
episodes[(s_num, e_num)] = video_files
|
||||
_log("DEBUG", f"Added episode S{s_num:02d}E{e_num:02d} to processing list")
|
||||
else:
|
||||
_log("WARNING", f"Season mismatch: directory={season_num}, filename={s_num} for S{s_num:02d}E{e_num:02d}")
|
||||
|
||||
_log("DEBUG", f"Total episodes found on disk: {len(episodes)}")
|
||||
return episodes
|
||||
|
||||
def _extract_season_number(self, dirname: str) -> Optional[int]:
|
||||
|
||||
Reference in New Issue
Block a user