fix: isolate movie and TV webhook processing to prevent cross-contamination

- Add prefixed batch keys (movie:imdbid, tv:imdbid) to prevent IMDb ID collisions
- Add path existence validation for Radarr webhooks to reject invalid mappings early
- Remove duplicate Radarr webhook handler code
- Add debug scripts for troubleshooting webhook and path mapping issues
- Create corrected .env template with fixed TV_PATHS and SONARR_ROOT_FOLDERS

This fixes the issue where TV path mapping failures caused movie webhooks
to process wrong movies due to shared batch queue corruption.
This commit is contained in:
2025-09-14 12:43:07 -04:00
parent 91881262ce
commit e741e4b046
7 changed files with 384 additions and 43 deletions
+6
View File
@@ -123,6 +123,12 @@ class PathMapper:
relative_path = radarr_path[len(radarr_root):].lstrip("/")
container_path = f"{container_root.rstrip('/')}/{relative_path}" if relative_path else container_root.rstrip("/")
_log("DEBUG", f"Mapped Radarr path {radarr_path} -> {container_path}")
# Check if the mapped path actually exists
from pathlib import Path
if not Path(container_path).exists():
_log("WARNING", f"Mapped container path does not exist: {container_path}")
return container_path
_log("WARNING", f"No container mapping found for Radarr path: {radarr_path}")