From e780b9e125ac2494a4720a1657bda74bb792647a Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Sun, 12 Oct 2025 10:57:20 -0400 Subject: [PATCH] debug: Add comprehensive logging to path search and title fallback - Show all search paths being checked and their existence status - Debug title fallback logic showing cleaned title comparisons - Track exactly where false matches occur (e.g., 'girls' in 'thegoldengirls') - Identify why only some search paths are processed --- utils/file_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/file_utils.py b/utils/file_utils.py index cc2e1d5..0b1e1b3 100644 --- a/utils/file_utils.py +++ b/utils/file_utils.py @@ -56,8 +56,11 @@ def find_media_path_by_imdb_and_title( _log("WARNING", f"Failed to process webhook path {webhook_path}: {e}") # Search by IMDb ID or title in configured paths + print(f"🔍 Total search paths to check: {len(search_paths)} - {[str(p) for p in search_paths]}") for media_path in search_paths: + print(f"🔍 Checking path: {media_path} (exists: {media_path.exists()})") if not media_path.exists(): + print(f"❌ Skipping non-existent path: {media_path}") continue # Search by IMDb ID first (more reliable) @@ -74,10 +77,13 @@ def find_media_path_by_imdb_and_title( # Search by title as fallback if title: title_clean = clean_title_for_search(title) + print(f"🔍 Title fallback: searching for '{title}' → cleaned: '{title_clean}'") for item in media_path.iterdir(): if item.is_dir() and "[imdb-" in item.name.lower(): item_clean = clean_title_for_search(item.name) + print(f"🔍 Checking directory: '{item.name}' → cleaned: '{item_clean}'") if title_clean in item_clean: + print(f"✅ Title match found: '{title_clean}' in '{item_clean}' → returning {item}") return item return None