debug: Add comprehensive webhook path mapping debug logging
Local Docker Build (Dev) / build-dev (pull_request) Successful in 4s

- Track webhook path provided from Sonarr webhooks
- Show path mapper availability and mapping results
- Trace why webhook paths fail and fallback to search occurs
- Version 2.0.27 for webhook path debugging
This commit is contained in:
2025-10-12 11:01:59 -04:00
parent a5b2381023
commit 7216491d76
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
2.0.26 2.0.27
+15
View File
@@ -40,20 +40,35 @@ def find_media_path_by_imdb_and_title(
Path to media directory if found, None otherwise Path to media directory if found, None otherwise
""" """
# Try webhook path first if provided # 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: if webhook_path and path_mapper:
try: try:
if hasattr(path_mapper, 'sonarr_path_to_container_path'): if hasattr(path_mapper, 'sonarr_path_to_container_path'):
container_path = path_mapper.sonarr_path_to_container_path(webhook_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'): elif hasattr(path_mapper, 'radarr_path_to_container_path'):
container_path = path_mapper.radarr_path_to_container_path(webhook_path) container_path = path_mapper.radarr_path_to_container_path(webhook_path)
print(f"🔍 Radarr path mapped: {webhook_path}{container_path}")
else: else:
container_path = webhook_path container_path = webhook_path
print(f"🔍 No mapper, using direct path: {container_path}")
path_obj = Path(container_path) path_obj = Path(container_path)
print(f"🔍 Mapped path exists: {path_obj.exists()} - {path_obj}")
if path_obj.exists(): if path_obj.exists():
print(f"✅ Using webhook path: {path_obj}")
return path_obj return path_obj
else:
print(f"❌ Webhook path doesn't exist, falling back to search")
except Exception as e: 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}") _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 # 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]}") print(f"🔍 Total search paths to check: {len(search_paths)} - {[str(p) for p in search_paths]}")