more radarr debugs
This commit is contained in:
+8
-17
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user