mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-16 13:27:35 +03:00
handle last_alert_time or last_detection_time being None when checking them against the frame_time
This commit is contained in:
parent
231edb8811
commit
9d0db214a0
@ -394,7 +394,10 @@ class ReviewSegmentMaintainer(threading.Thread):
|
||||
|
||||
if activity.has_activity_category(SeverityEnum.alert):
|
||||
# update current time for last alert activity
|
||||
if frame_time > segment.last_alert_time:
|
||||
if (
|
||||
segment.last_alert_time is None
|
||||
or frame_time > segment.last_alert_time
|
||||
):
|
||||
segment.last_alert_time = frame_time
|
||||
|
||||
if segment.severity != SeverityEnum.alert:
|
||||
@ -405,7 +408,10 @@ class ReviewSegmentMaintainer(threading.Thread):
|
||||
should_update_image = True
|
||||
|
||||
if activity.has_activity_category(SeverityEnum.detection):
|
||||
if frame_time > segment.last_detection_time:
|
||||
if (
|
||||
segment.last_detection_time is None
|
||||
or frame_time > segment.last_detection_time
|
||||
):
|
||||
segment.last_detection_time = frame_time
|
||||
|
||||
for object in activity.get_all_objects():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user