Catch case where user tries to end definite manual event

This commit is contained in:
Nicolas Mowen 2024-08-11 06:24:04 -06:00
parent 9b96211faf
commit b68f7e7ddc

View File

@ -503,8 +503,13 @@ class ReviewSegmentMaintainer(threading.Thread):
# temporarily make it so this event can not end # temporarily make it so this event can not end
current_segment.last_update = sys.maxsize current_segment.last_update = sys.maxsize
elif manual_info["state"] == ManualEventState.end: elif manual_info["state"] == ManualEventState.end:
self.indefinite_events[camera].pop(manual_info["event_id"]) event_id = manual_info["event_id"]
current_segment.last_update = manual_info["end_time"]
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: else:
if topic == DetectionTypeEnum.video: if topic == DetectionTypeEnum.video:
self.check_if_new_segment( self.check_if_new_segment(