running down radarr API issues

This commit is contained in:
2025-09-08 12:06:01 -04:00
parent e4da166300
commit 78c09e3b13
2 changed files with 23 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
0.3.2
0.3.3
+22 -4
View File
@@ -278,20 +278,38 @@ class RadarrClient:
if event_type == "moviefileimported":
imported_path = (event.get("data", {}).get("importedPath", "") or
event.get("data", {}).get("path", "") or
event.get("importedPath", "")).lower()
event.get("importedPath", "") or
event.get("sourcePath", "")).lower()
if imported_path:
_log("DEBUG", f"Found moviefileimported event with path: {imported_path}")
# Check for IMDb ID match
movie_imdb = (movie_info.get("imdbId", "") or "").lower()
movie_title = (movie_info.get("title", "") or "").lower()
movie_year = str(movie_info.get("year", ""))
# First try IMDb ID match
if movie_imdb and (
f"[imdb-{movie_imdb}]" in imported_path or
f"[{movie_imdb}]" in imported_path
f"[{movie_imdb}]" in imported_path or
movie_imdb in imported_path
):
date_iso = datetime.fromisoformat(event["date"].replace("Z", "+00:00")).astimezone(timezone.utc).isoformat(timespec="seconds")
_log("INFO", f"✅ FOUND IMPORT: exact IMDb match at {date_iso}")
earliest_real_import = date_iso
break # Stop processing more pages
break
# Then try title/year match
if movie_title and movie_year:
# Clean strings for comparison
clean_title = movie_title.replace(" ", ".").replace(":", ".").lower()
clean_path = imported_path.replace(" ", ".").replace("-", ".").replace("_", ".").lower()
# Look for both title and year
if clean_title in clean_path and movie_year in clean_path:
date_iso = datetime.fromisoformat(event["date"].replace("Z", "+00:00")).astimezone(timezone.utc).isoformat(timespec="seconds")
_log("INFO", f"✅ FOUND IMPORT: title/year match at {date_iso}")
earliest_real_import = date_iso
break
# Fallback to normal import analysis
is_real, reason, date_iso = self._analyze_event_for_import(event, movie_info)