sonarr-matching (#48)
Local Docker Build (Dev) / build-dev (push) Successful in 4s

Reviewed-on: #48
This commit was merged in pull request #48.
This commit is contained in:
2025-10-12 11:02:36 -04:00
parent 80df0a0278
commit 53d7753231
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -40,20 +40,35 @@ def find_media_path_by_imdb_and_title(
Path to media directory if found, None otherwise
"""
# Try webhook path first if provided
print(f"🔍 Webhook path provided: {webhook_path}")
print(f"🔍 Path mapper available: {path_mapper is not None}")
if webhook_path and path_mapper:
try:
if hasattr(path_mapper, 'sonarr_path_to_container_path'):
container_path = path_mapper.sonarr_path_to_container_path(webhook_path)
print(f"🔍 Sonarr path mapped: {webhook_path}{container_path}")
elif hasattr(path_mapper, 'radarr_path_to_container_path'):
container_path = path_mapper.radarr_path_to_container_path(webhook_path)
print(f"🔍 Radarr path mapped: {webhook_path}{container_path}")
else:
container_path = webhook_path
print(f"🔍 No mapper, using direct path: {container_path}")
path_obj = Path(container_path)
print(f"🔍 Mapped path exists: {path_obj.exists()} - {path_obj}")
if path_obj.exists():
print(f"✅ Using webhook path: {path_obj}")
return path_obj
else:
print(f"❌ Webhook path doesn't exist, falling back to search")
except Exception as e:
print(f"❌ Failed to process webhook path {webhook_path}: {e}")
_log("WARNING", f"Failed to process webhook path {webhook_path}: {e}")
else:
if not webhook_path:
print(f"❌ No webhook path provided")
if not path_mapper:
print(f"❌ No path mapper available")
# 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]}")