Skip to content

Commit

Permalink
Fix snapshot access (#13996)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 authored Sep 27, 2024
1 parent da1478c commit ddfdb71
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions frigate/events/maintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,27 +163,22 @@ def handle_object_detection(
)
)

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
Expand Down

0 comments on commit ddfdb71

Please sign in to comment.