NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Clear ongoing reviews on startup (#11097)
Nicolas Mowenc035241b39ef
diff --git a/frigate/comms/dispatcher.py b/frigate/comms/dispatcher.pyindex 0b466a01c0..6fc3885e02 100644--- a/frigate/comms/dispatcher.py+++ b/frigate/comms/dispatcher.py@@ -1,5 +1,6 @@"""Handle communication between Frigate and other applications."""+import datetimeimport loggingfrom abc import ABC, abstractmethodfrom typing import Any, Callable, Optional@@ -7,6 +8,7 @@ from typing import Any, Callable, Optionalfrom frigate.comms.config_updater import ConfigPublisherfrom frigate.config import BirdseyeModeEnum, FrigateConfigfrom frigate.const import (+ CLEAR_ONGOING_REVIEW_SEGMENTS,INSERT_MANY_RECORDINGS,INSERT_PREVIEW,REQUEST_REGION_GRID,@@ -116,6 +118,10 @@ class Dispatcher:).execute())+ elif topic == CLEAR_ONGOING_REVIEW_SEGMENTS:+ ReviewSegment.update(end_time=datetime.datetime.now().timestamp()).where(+ ReviewSegment.end_time == None+ ).execute()else:self.publish(topic, payload, retain=False)diff --git a/frigate/const.py b/frigate/const.pyindex 28ab83c8a0..168d880fb5 100644--- a/frigate/const.py+++ b/frigate/const.py@@ -79,6 +79,7 @@ INSERT_MANY_RECORDINGS = "insert_many_recordings"INSERT_PREVIEW = "insert_preview"REQUEST_REGION_GRID = "request_region_grid"UPSERT_REVIEW_SEGMENT = "upsert_review_segment"+CLEAR_ONGOING_REVIEW_SEGMENTS = "clear_ongoing_review_segments"# Autotrackingdiff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.pyindex 750ed44ba2..2956416569 100644--- a/frigate/review/maintainer.py+++ b/frigate/review/maintainer.py@@ -19,7 +19,12 @@ from frigate.comms.config_updater import ConfigSubscriberfrom frigate.comms.detections_updater import DetectionSubscriber, DetectionTypeEnumfrom frigate.comms.inter_process import InterProcessRequestorfrom 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 ManualEventStatefrom frigate.models import ReviewSegmentfrom 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,