diff --git a/VERSION b/VERSION index abd4105..3a4036f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.4 +0.2.5 diff --git a/clients/radarr_client.py b/clients/radarr_client.py index fd2ae1f..d877a39 100644 --- a/clients/radarr_client.py +++ b/clients/radarr_client.py @@ -229,12 +229,34 @@ class RadarrClient: is_real, reason, date_iso = self._analyze_event_for_import(event, movie_info) if is_real and date_iso: - source_path = (event.get("data", {}).get("sourcePath") or "").lower() - source_title = (event.get("data", {}).get("sourceTitle") or "").lower() + # Extract all possible identifiers + source_path = (event.get("data", {}).get("sourcePath", "") or + event.get("data", {}).get("droppedPath", "") or + event.get("sourcePath", "") or "").lower() + source_title = (event.get("data", {}).get("sourceTitle", "") or + event.get("sourceTitle", "") or "").lower() - if movie_info and (movie_info.get("imdbId") or "").lower() in (source_path + source_title): + # Get movie identifiers + movie_imdb = (movie_info.get("imdbId", "") or "").lower() + movie_title = (movie_info.get("title", "") or "").lower() + + _log("DEBUG", f"Validating import - Path: {source_path}") + _log("DEBUG", f"Validating import - Title: {source_title}") + _log("DEBUG", f"Validating against - IMDb: {movie_imdb}, Title: {movie_title}") + + # More flexible validation + valid = False + if movie_imdb and (movie_imdb in source_path or movie_imdb in source_title): + valid = True + _log("DEBUG", "✅ Validated by IMDb ID") + elif movie_title and (movie_title in source_path or movie_title in source_title): + valid = True + _log("DEBUG", "✅ Validated by title") + + if valid: _log("INFO", f"✅ FOUND REAL IMPORT: {event_type} at {date_iso} - {reason} (path validated)") earliest_real_import = date_iso + break # Stop processing more pages else: _log("DEBUG", f"⚠️ Skipping import - path validation failed") # We found a real import - we can stop here since events are chronologically ordered