Skip to content

Commit

Permalink
Catch case where user tries to end definite manual event (blakeblacks…
Browse files Browse the repository at this point in the history
…hear#12951)

* Catch case where user tries to end definite manual event

* Formatting
  • Loading branch information
NickM-27 authored and sandnabba committed Aug 14, 2024
1 parent 7cfb1d0 commit d1555ff
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions frigate/review/maintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,15 @@ def run(self) -> None:
# temporarily make it so this event can not end
current_segment.last_update = sys.maxsize
elif manual_info["state"] == ManualEventState.end:
self.indefinite_events[camera].pop(manual_info["event_id"])
current_segment.last_update = manual_info["end_time"]
event_id = manual_info["event_id"]

if event_id in self.indefinite_events[camera]:
self.indefinite_events[camera].pop(event_id)
current_segment.last_update = manual_info["end_time"]
else:
logger.error(
f"Event with ID {event_id} has a set duration and can not be ended manually."
)
else:
if topic == DetectionTypeEnum.video:
self.check_if_new_segment(
Expand Down

0 comments on commit d1555ff

Please sign in to comment.