mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-12 17:52:48 +03:00
Clean up enabled config updates (#17547)
* Immediately end review item for disabled cameras * Clean up checks * Remove duplicate enabled checkers * Cleanup
This commit is contained in:
@@ -482,6 +482,10 @@ class ReviewSegmentMaintainer(threading.Thread):
|
||||
camera_name = updated_record_topic.rpartition("/")[-1]
|
||||
self.config.cameras[camera_name].record = updated_record_config
|
||||
|
||||
# immediately end segment
|
||||
if not updated_record_config.enabled:
|
||||
self.end_segment(camera_name)
|
||||
|
||||
if updated_review_topic:
|
||||
camera_name = updated_review_topic.rpartition("/")[-1]
|
||||
self.config.cameras[camera_name].review = updated_review_config
|
||||
@@ -492,6 +496,10 @@ class ReviewSegmentMaintainer(threading.Thread):
|
||||
camera_name
|
||||
].enabled = updated_enabled_config.enabled
|
||||
|
||||
# immediately end segment as we may not get another update
|
||||
if not updated_enabled_config.enabled:
|
||||
self.end_segment(camera_name)
|
||||
|
||||
(topic, data) = self.detection_subscriber.check_for_update(timeout=1)
|
||||
|
||||
if not topic:
|
||||
@@ -523,16 +531,14 @@ class ReviewSegmentMaintainer(threading.Thread):
|
||||
if camera not in self.indefinite_events:
|
||||
self.indefinite_events[camera] = {}
|
||||
|
||||
current_segment = self.active_review_segments.get(camera)
|
||||
|
||||
if (
|
||||
not self.config.cameras[camera].enabled
|
||||
or not self.config.cameras[camera].record.enabled
|
||||
):
|
||||
if current_segment:
|
||||
self.end_segment(camera)
|
||||
continue
|
||||
|
||||
current_segment = self.active_review_segments.get(camera)
|
||||
|
||||
# Check if the current segment should be processed based on enabled settings
|
||||
if current_segment:
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user