mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Show correct previous state when updating for end (#12122)
* Show correct previous state when updating for end * remove log * Formatting
This commit is contained in:
parent
9bbb88cdcb
commit
abc1ecfb60
@ -213,7 +213,11 @@ class ReviewSegmentMaintainer(threading.Thread):
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
def end_segment(self, segment: PendingReviewSegment) -> None:
|
def end_segment(
|
||||||
|
self,
|
||||||
|
segment: PendingReviewSegment,
|
||||||
|
prev_data: dict[str, any],
|
||||||
|
) -> None:
|
||||||
"""End segment."""
|
"""End segment."""
|
||||||
final_data = segment.get_data(ended=True)
|
final_data = segment.get_data(ended=True)
|
||||||
self.requestor.send_data(UPSERT_REVIEW_SEGMENT, final_data)
|
self.requestor.send_data(UPSERT_REVIEW_SEGMENT, final_data)
|
||||||
@ -223,7 +227,7 @@ class ReviewSegmentMaintainer(threading.Thread):
|
|||||||
json.dumps(
|
json.dumps(
|
||||||
{
|
{
|
||||||
"type": "end",
|
"type": "end",
|
||||||
"before": end_data,
|
"before": prev_data,
|
||||||
"after": end_data,
|
"after": end_data,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@ -309,9 +313,9 @@ class ReviewSegmentMaintainer(threading.Thread):
|
|||||||
if segment.severity == SeverityEnum.alert and frame_time > (
|
if segment.severity == SeverityEnum.alert and frame_time > (
|
||||||
segment.last_update + THRESHOLD_ALERT_ACTIVITY
|
segment.last_update + THRESHOLD_ALERT_ACTIVITY
|
||||||
):
|
):
|
||||||
self.end_segment(segment)
|
self.end_segment(segment, prev_data)
|
||||||
elif frame_time > (segment.last_update + THRESHOLD_DETECTION_ACTIVITY):
|
elif frame_time > (segment.last_update + THRESHOLD_DETECTION_ACTIVITY):
|
||||||
self.end_segment(segment)
|
self.end_segment(segment, prev_data)
|
||||||
|
|
||||||
def check_if_new_segment(
|
def check_if_new_segment(
|
||||||
self,
|
self,
|
||||||
|
Loading…
Reference in New Issue
Block a user