From faf4dab591da55b064cb2a6cd6b2678ca997f4f0 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 24 Apr 2024 07:21:03 -0600 Subject: [PATCH] Clear ongoing review items on startup --- frigate/review/maintainer.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index 750ed44ba..295641656 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -19,7 +19,12 @@ from frigate.comms.config_updater import ConfigSubscriber from frigate.comms.detections_updater import DetectionSubscriber, DetectionTypeEnum from frigate.comms.inter_process import InterProcessRequestor from frigate.config import CameraConfig, FrigateConfig -from frigate.const import ALL_ATTRIBUTE_LABELS, CLIPS_DIR, UPSERT_REVIEW_SEGMENT +from frigate.const import ( + ALL_ATTRIBUTE_LABELS, + CLEAR_ONGOING_REVIEW_SEGMENTS, + CLIPS_DIR, + UPSERT_REVIEW_SEGMENT, +) from frigate.events.external import ManualEventState from frigate.models import ReviewSegment from frigate.object_processing import TrackedObject @@ -146,6 +151,9 @@ class ReviewSegmentMaintainer(threading.Thread): self.stop_event = stop_event + # clear ongoing review segments from last instance + self.requestor.send_data(CLEAR_ONGOING_REVIEW_SEGMENTS, "") + def new_segment( self, segment: PendingReviewSegment,