update logs and try statments

This commit is contained in:
2025-09-08 15:29:30 -04:00
parent e389893e14
commit cd77065a0f
+10 -1
View File
@@ -259,9 +259,11 @@ class RadarrClient:
if not event_type: if not event_type:
continue continue
# Convert event type to int
try: try:
event_type = int(event_type) event_type = int(event_type)
except (ValueError, TypeError): except (ValueError, TypeError):
_log("DEBUG", f"Invalid event type: {event_type}")
continue continue
# Check for grab events (type 1) # Check for grab events (type 1)
@@ -283,10 +285,17 @@ class RadarrClient:
pass pass
continue continue
# Only process import events # Only process import events (type 3)
if event_type != self.EVENT_TYPE_IMPORTED:
continue
imported_path = None
try: try:
data = json.loads(event.get("data", "{}")) data = json.loads(event.get("data", "{}"))
imported_path = data.get("importedPath", "").lower() imported_path = data.get("importedPath", "").lower()
except (json.JSONDecodeError, AttributeError) as e:
_log("DEBUG", f"Failed to get imported path: {e}")
continue
if not imported_path: if not imported_path:
continue continue