Fix snapshot access (#13996)

This commit is contained in:
Nicolas Mowen 2024-09-26 19:05:48 -06:00 committed by GitHub
parent da1478c0c1
commit ddfdb71783
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -163,27 +163,22 @@ class EventProcessor(threading.Thread):
) )
) )
try: attributes = (
attributes = [ None
( if event_data["snapshot"] is None
None else [
if event_data["snapshot"] is None {
else { "box": to_relative_box(
"box": to_relative_box( width,
width, height,
height, a["box"],
a["box"], ),
), "label": a["label"],
"label": a["label"], "score": a["score"],
"score": a["score"], }
}
)
for a in event_data["snapshot"]["attributes"] for a in event_data["snapshot"]["attributes"]
] ]
except TypeError: )
logger.warning(
f"Failed to parse attributes of event data, event data is {event_data}"
)
# keep these from being set back to false because the event # keep these from being set back to false because the event
# may have started while recordings and snapshots were enabled # may have started while recordings and snapshots were enabled