more radarr debugs
This commit is contained in:
@@ -97,7 +97,13 @@ class RadarrClient:
|
|||||||
imdb_id = imdb_id if imdb_id.startswith("tt") else f"tt{imdb_id}"
|
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}")
|
_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")
|
all_movies = self._get("/api/v3/movie")
|
||||||
if isinstance(all_movies, list):
|
if isinstance(all_movies, list):
|
||||||
_log("DEBUG", f"Got {len(all_movies)} total movies, filtering by IMDb ID")
|
_log("DEBUG", f"Got {len(all_movies)} total movies, filtering by IMDb ID")
|
||||||
|
|||||||
+8
-17
@@ -166,33 +166,24 @@ class PathMapper:
|
|||||||
path_lower = str(path).lower()
|
path_lower = str(path).lower()
|
||||||
return any(indicator in path_lower for indicator in self.download_path_indicators)
|
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.
|
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:
|
Returns:
|
||||||
(is_from_downloads, reason)
|
(is_from_downloads, reason)
|
||||||
"""
|
"""
|
||||||
if not source_path:
|
if not source_path:
|
||||||
return False, "no_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
|
# Extract potential IMDb ID from path
|
||||||
if movie_path:
|
imdb_match = re.search(r'(?:imdb-|tt)(\d{6,8})', path_lower)
|
||||||
movie_lower = str(movie_path).lower()
|
if imdb_match:
|
||||||
movie_basename = os.path.basename(movie_lower)
|
imdb_id = f"tt{imdb_match.group(1)}"
|
||||||
source_basename = os.path.basename(path_lower)
|
_log("DEBUG", f"Found IMDb ID in path: {imdb_id}")
|
||||||
|
return True, f"imdb_in_path({imdb_id})"
|
||||||
# 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"
|
|
||||||
|
|
||||||
# Check for download indicators
|
# Check for download indicators
|
||||||
for indicator in self.download_path_indicators:
|
for indicator in self.download_path_indicators:
|
||||||
|
|||||||
Reference in New Issue
Block a user