another api debug
This commit is contained in:
@@ -229,12 +229,34 @@ class RadarrClient:
|
||||
is_real, reason, date_iso = self._analyze_event_for_import(event, movie_info)
|
||||
|
||||
if is_real and date_iso:
|
||||
source_path = (event.get("data", {}).get("sourcePath") or "").lower()
|
||||
source_title = (event.get("data", {}).get("sourceTitle") or "").lower()
|
||||
# Extract all possible identifiers
|
||||
source_path = (event.get("data", {}).get("sourcePath", "") or
|
||||
event.get("data", {}).get("droppedPath", "") or
|
||||
event.get("sourcePath", "") or "").lower()
|
||||
source_title = (event.get("data", {}).get("sourceTitle", "") or
|
||||
event.get("sourceTitle", "") or "").lower()
|
||||
|
||||
if movie_info and (movie_info.get("imdbId") or "").lower() in (source_path + source_title):
|
||||
# Get movie identifiers
|
||||
movie_imdb = (movie_info.get("imdbId", "") or "").lower()
|
||||
movie_title = (movie_info.get("title", "") or "").lower()
|
||||
|
||||
_log("DEBUG", f"Validating import - Path: {source_path}")
|
||||
_log("DEBUG", f"Validating import - Title: {source_title}")
|
||||
_log("DEBUG", f"Validating against - IMDb: {movie_imdb}, Title: {movie_title}")
|
||||
|
||||
# More flexible validation
|
||||
valid = False
|
||||
if movie_imdb and (movie_imdb in source_path or movie_imdb in source_title):
|
||||
valid = True
|
||||
_log("DEBUG", "✅ Validated by IMDb ID")
|
||||
elif movie_title and (movie_title in source_path or movie_title in source_title):
|
||||
valid = True
|
||||
_log("DEBUG", "✅ Validated by title")
|
||||
|
||||
if valid:
|
||||
_log("INFO", f"✅ FOUND REAL IMPORT: {event_type} at {date_iso} - {reason} (path validated)")
|
||||
earliest_real_import = date_iso
|
||||
break # Stop processing more pages
|
||||
else:
|
||||
_log("DEBUG", f"⚠️ Skipping import - path validation failed")
|
||||
# We found a real import - we can stop here since events are chronologically ordered
|
||||
|
||||
Reference in New Issue
Block a user