diff --git a/VERSION b/VERSION index d169b2f..c5d54ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.8 +0.0.9 diff --git a/webhook_server.py b/webhook_server.py index 7ed8438..a686915 100644 --- a/webhook_server.py +++ b/webhook_server.py @@ -286,14 +286,17 @@ class RadarrClient: # Try direct movie search first res = self._get("/api/v3/movie", {"imdbId": imdb_id}) - if isinstance(res, list) and res: - movie = res[0] - _log("DEBUG", f"Radarr API: Found movie via direct search: {movie.get('title')} (ID: {movie.get('id')})") - return movie - + if isinstance(res, list): + # Filter results to find exact IMDb ID match + for movie in res: + if movie.get("imdbId") == imdb_id: + _log("DEBUG", f"Radarr API: Found exact match: {movie.get('title')} (ID: {movie.get('id')})") + return movie + _log("WARNING", f"Radarr API: Got {len(res)} movies but none match IMDb {imdb_id}") + # Try lookup endpoint res = self._get("/api/v3/movie/lookup/imdb", {"imdbId": imdb_id}) - if isinstance(res, dict) and res.get("id"): + if isinstance(res, dict) and res.get("id") and res.get("imdbId") == imdb_id: _log("DEBUG", f"Radarr API: Found movie via lookup: {res.get('title')} (ID: {res.get('id')})") return res