diff --git a/clients/radarr_client.py b/clients/radarr_client.py index 8f2bb7d..df5f869 100644 --- a/clients/radarr_client.py +++ b/clients/radarr_client.py @@ -259,9 +259,11 @@ class RadarrClient: if not event_type: continue + # Convert event type to int try: event_type = int(event_type) except (ValueError, TypeError): + _log("DEBUG", f"Invalid event type: {event_type}") continue # Check for grab events (type 1) @@ -283,12 +285,19 @@ class RadarrClient: pass continue - # Only process import events + # Only process import events (type 3) + if event_type != self.EVENT_TYPE_IMPORTED: + continue + imported_path = None try: data = json.loads(event.get("data", "{}")) imported_path = data.get("importedPath", "").lower() - if not imported_path: - continue + except (json.JSONDecodeError, AttributeError) as e: + _log("DEBUG", f"Failed to get imported path: {e}") + continue + + if not imported_path: + continue movie_imdb = (movie_info.get("imdbId", "") or "").lower() movie_title = (movie_info.get("title", "") or "").lower()