fix
This commit is contained in:
+9
-6
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user