fix looking at radarr in a string and us eventid

This commit is contained in:
2025-09-08 15:35:33 -04:00
parent cd77065a0f
commit 65794ae038
+14 -2
View File
@@ -259,11 +259,23 @@ class RadarrClient:
if not event_type: if not event_type:
continue continue
# Convert event type to int # Convert event type to int or handle string types
try: try:
if isinstance(event_type, str):
# Map string event types to numeric values
string_to_numeric = {
"grabbed": self.EVENT_TYPE_GRABBED,
"downloadFolderImported": self.EVENT_TYPE_IMPORTED,
"movieFileImported": self.EVENT_TYPE_IMPORTED,
"downloadFailed": self.EVENT_TYPE_FAILED,
"movieFileRenamed": self.EVENT_TYPE_RENAMED,
"movieFileDeleted": 5 # Not in our constants but common
}
event_type = string_to_numeric.get(event_type, 0)
else:
event_type = int(event_type) event_type = int(event_type)
except (ValueError, TypeError): except (ValueError, TypeError):
_log("DEBUG", f"Invalid event type: {event_type}") _log("DEBUG", f"Unknown event type: {event_type}")
continue continue
# Check for grab events (type 1) # Check for grab events (type 1)