fix looking at radarr in a string and us eventid
This commit is contained in:
@@ -259,11 +259,23 @@ class RadarrClient:
|
||||
if not event_type:
|
||||
continue
|
||||
|
||||
# Convert event type to int
|
||||
# Convert event type to int or handle string types
|
||||
try:
|
||||
event_type = int(event_type)
|
||||
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)
|
||||
except (ValueError, TypeError):
|
||||
_log("DEBUG", f"Invalid event type: {event_type}")
|
||||
_log("DEBUG", f"Unknown event type: {event_type}")
|
||||
continue
|
||||
|
||||
# Check for grab events (type 1)
|
||||
|
||||
Reference in New Issue
Block a user