more radarr debugs

This commit is contained in:
2025-09-08 11:20:00 -04:00
parent 75bf1b470e
commit 946b024fd3
3 changed files with 16 additions and 19 deletions
+1 -1
View File
@@ -1 +1 @@
0.2.7
0.2.8
+7 -1
View File
@@ -97,7 +97,13 @@ class RadarrClient:
imdb_id = imdb_id if imdb_id.startswith("tt") else f"tt{imdb_id}"
_log("DEBUG", f"Looking up movie by IMDb ID: {imdb_id}")
# Method 1: Get all movies and filter by IMDb (most reliable)
# Method 1: Direct lookup by ID
movie = self._get(f"/api/v3/movie/lookup/imdb/{imdb_id}")
if isinstance(movie, dict) and movie.get("imdbId", "").lower() == imdb_id.lower():
_log("INFO", f"Found via direct lookup: {movie.get('title')} (ID: {movie.get('id')})")
return movie
# Method 2: Get all movies and filter by IMDb (fallback)
all_movies = self._get("/api/v3/movie")
if isinstance(all_movies, list):
_log("DEBUG", f"Got {len(all_movies)} total movies, filtering by IMDb ID")
+8 -17
View File
@@ -166,33 +166,24 @@ class PathMapper:
path_lower = str(path).lower()
return any(indicator in path_lower for indicator in self.download_path_indicators)
def analyze_import_source_path(self, source_path: str, movie_path: str = None) -> Tuple[bool, str]:
def analyze_import_source_path(self, source_path: str) -> Tuple[bool, str]:
"""
Analyze import source path to determine if it's from downloads.
Args:
source_path: Path to analyze
movie_path: Optional movie path to validate against
Returns:
(is_from_downloads, reason)
"""
if not source_path:
return False, "no_source_path"
path_lower = source_path.lower()
path_lower = str(source_path).lower()
# If movie_path is provided, check if source path has matching IMDb ID or movie name
if movie_path:
movie_lower = str(movie_path).lower()
movie_basename = os.path.basename(movie_lower)
source_basename = os.path.basename(path_lower)
# Extract IMDb ID pattern
imdb_match = re.search(r'tt\d+', movie_basename)
if imdb_match and imdb_match.group(0) in source_basename:
_log("DEBUG", f"Source path matches movie IMDb ID: {imdb_match.group(0)}")
return True, "matched_movie_imdb"
# Extract potential IMDb ID from path
imdb_match = re.search(r'(?:imdb-|tt)(\d{6,8})', path_lower)
if imdb_match:
imdb_id = f"tt{imdb_match.group(1)}"
_log("DEBUG", f"Found IMDb ID in path: {imdb_id}")
return True, f"imdb_in_path({imdb_id})"
# Check for download indicators
for indicator in self.download_path_indicators: