Fix movie webhook comprehensive IMDb detection and batch processing
- Fix movie webhook to use comprehensive IMDb detection (dir, filename, movie.nfo) instead of simple string search - Fix batch processing NameError: use path_obj instead of undefined path variable - Version bump to 1.8.3 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+13
-4
@@ -1623,7 +1623,7 @@ class WebhookBatcher:
|
||||
if media_type == 'movie':
|
||||
expected_imdb = key.replace('movie:', '') if key.startswith('movie:') else key
|
||||
# Use comprehensive IMDb detection (directory, filenames, NFO content)
|
||||
detected_imdb = self.nfo_manager.find_movie_imdb_id(path)
|
||||
detected_imdb = self.nfo_manager.find_movie_imdb_id(path_obj)
|
||||
|
||||
# Check if detected IMDb matches expected (handle both full IMDb IDs and just numbers)
|
||||
imdb_match = False
|
||||
@@ -1834,9 +1834,18 @@ async def radarr_webhook(request: Request, background_tasks: BackgroundTasks):
|
||||
_log("ERROR", f"This prevents processing wrong movies due to path mapping issues")
|
||||
return {"status": "error", "message": f"Mapped movie path does not exist: {container_path}"}
|
||||
|
||||
# Verify the path contains the expected IMDb ID
|
||||
if imdb_id not in container_path.lower():
|
||||
_log("WARNING", f"IMDb ID {imdb_id} not found in container path {container_path}")
|
||||
# Verify the path contains the expected IMDb ID using comprehensive detection
|
||||
detected_imdb = nfo_manager.find_movie_imdb_id(Path(container_path))
|
||||
imdb_match = False
|
||||
if detected_imdb:
|
||||
if detected_imdb == imdb_id or detected_imdb.replace('tt', '') == imdb_id.replace('tt', ''):
|
||||
imdb_match = True
|
||||
|
||||
if not imdb_match:
|
||||
_log("WARNING", f"IMDb ID {imdb_id} not found via comprehensive detection in {container_path}")
|
||||
_log("DEBUG", f"Detected IMDb: {detected_imdb}, Expected: {imdb_id}")
|
||||
else:
|
||||
_log("DEBUG", f"IMDb ID validated: {imdb_id} matches detected {detected_imdb}")
|
||||
|
||||
# Create movie-specific webhook data with proper path validation
|
||||
movie_webhook_data = {
|
||||
|
||||
Reference in New Issue
Block a user