From 000d57e9fe0bf63a6cd6df38157ca9e183b42f2e Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Sun, 12 Oct 2025 10:51:52 -0400 Subject: [PATCH 1/4] debug: Add logging to find_media_path_by_imdb_and_title to trace search behavior - Add debug prints to see glob patterns being used - Track number of matches found and which paths are returned - Help diagnose why wrong TV series paths are still being found --- utils/file_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/file_utils.py b/utils/file_utils.py index 8bce466..cc2e1d5 100644 --- a/utils/file_utils.py +++ b/utils/file_utils.py @@ -64,8 +64,11 @@ def find_media_path_by_imdb_and_title( if imdb_id: # Use proper glob pattern - escape brackets to match literal [imdb-ID] pattern = str(media_path / f"*\\[imdb-{imdb_id}\\]*") + print(f"🔍 Searching with pattern: {pattern}") matches = glob.glob(pattern) + print(f"🔍 Pattern matches found: {len(matches)} - {matches[:3] if matches else 'None'}") if matches: + print(f"✅ Returning first match: {matches[0]}") return Path(matches[0]) # Search by title as fallback From 716dcc05e845bd99480a32ceb57e3ee8b2973f89 Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Sun, 12 Oct 2025 10:52:48 -0400 Subject: [PATCH 2/4] chore: Bump version to 2.0.25 for sonarr-matching fixes - Increment version for comprehensive TV IMDb detection fixes - Includes glob pattern fix and batch validation improvements - Ready for deployment and testing --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8f4c02d..efb4534 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.24 +2.0.25 From e780b9e125ac2494a4720a1657bda74bb792647a Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Sun, 12 Oct 2025 10:57:20 -0400 Subject: [PATCH 3/4] 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 From 80df0a0278e6d17b3e3b5244ab371da8af9ae9b5 Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Sun, 12 Oct 2025 10:57:33 -0400 Subject: [PATCH 4/4] chore: Bump version to 2.0.26 for enhanced debug logging --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index efb4534..f6ee962 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.25 +2.0.26