From ddfdb71783f8bf78941242578cfdfaac25f871db Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 26 Sep 2024 19:05:48 -0600 Subject: [PATCH] Fix snapshot access (#13996) --- frigate/events/maintainer.py | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/frigate/events/maintainer.py b/frigate/events/maintainer.py index 10cdb6b43..eca109c3e 100644 --- a/frigate/events/maintainer.py +++ b/frigate/events/maintainer.py @@ -163,27 +163,22 @@ class EventProcessor(threading.Thread): ) ) - try: - attributes = [ - ( - None - if event_data["snapshot"] is None - else { - "box": to_relative_box( - width, - height, - a["box"], - ), - "label": a["label"], - "score": a["score"], - } - ) + attributes = ( + None + if event_data["snapshot"] is None + else [ + { + "box": to_relative_box( + width, + height, + a["box"], + ), + "label": a["label"], + "score": a["score"], + } 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 # may have started while recordings and snapshots were enabled