From cabc250fd717ba2f2e9e5b5932dfa43a2bd047e8 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Tue, 20 Jan 2026 17:32:20 -0500 Subject: [PATCH 01/18] Allow detections via API --- frigate/review/maintainer.py | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index 917c0c5acd..d89d74f3bb 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -699,7 +699,13 @@ def run(self) -> None: topic == DetectionTypeEnum.api and self.config.cameras[camera].review.alerts.enabled ): - current_segment.severity = SeverityEnum.alert + if ( + self.config.cameras[camera].review.detections.enabled + and manual_info["label"].split(': ')[0] in self.config.cameras[camera].review.detections.labels + ): + current_segment.severity = SeverityEnum.detection + else: + current_segment.severity = SeverityEnum.alert elif ( topic == DetectionTypeEnum.lpr and self.config.cameras[camera].review.detections.enabled @@ -717,7 +723,13 @@ def run(self) -> None: topic == DetectionTypeEnum.api and self.config.cameras[camera].review.alerts.enabled ): - current_segment.severity = SeverityEnum.alert + if ( + self.config.cameras[camera].review.detections.enabled + and manual_info["label"].split(': ')[0] in self.config.cameras[camera].review.detections.labels + ): + current_segment.severity = SeverityEnum.detection + else: + current_segment.severity = SeverityEnum.alert elif ( topic == DetectionTypeEnum.lpr and self.config.cameras[camera].review.detections.enabled @@ -789,11 +801,22 @@ def run(self) -> None: detections, ) elif topic == DetectionTypeEnum.api: - if self.config.cameras[camera].review.alerts.enabled: + severity = None + if ( + self.config.cameras[camera].review.detections.enabled + and manual_info["label"].split(': ')[0] in self.config.cameras[camera].review.detections.labels + ): + severity = SeverityEnum.detection + if (self.config.cameras[camera].review.alerts.enabled + and not severity + ): + severity = SeverityEnum.alert + + if severity: self.active_review_segments[camera] = PendingReviewSegment( camera, frame_time, - SeverityEnum.alert, + severity, {manual_info["event_id"]: manual_info["label"]}, {}, [], @@ -820,7 +843,7 @@ def run(self) -> None: ].last_detection_time = manual_info["end_time"] else: logger.warning( - f"Manual event API has been called for {camera}, but alerts are disabled. This manual event will not appear as an alert." + f"Manual event API has been called for {camera}, but alerts and detections are disabled. This manual event will not appear as an alert or detection." ) elif topic == DetectionTypeEnum.lpr: if self.config.cameras[camera].review.detections.enabled: From 8281dacd9227d244b7ff9c48ddc377c3490f0459 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Tue, 20 Jan 2026 19:12:33 -0500 Subject: [PATCH 02/18] api-detections testing --- frigate/review/maintainer.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index d89d74f3bb..1d3ad886bf 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -701,11 +701,14 @@ def run(self) -> None: ): if ( self.config.cameras[camera].review.detections.enabled - and manual_info["label"].split(': ')[0] in self.config.cameras[camera].review.detections.labels + and manual_info["label"].split(": ")[0] + in self.config.cameras[camera].review.detections.labels ): - current_segment.severity = SeverityEnum.detection + # current_segment.severity = SeverityEnum.detection + current_segment.last_detection_time = frame_time else: - current_segment.severity = SeverityEnum.alert + # current_segment.severity = SeverityEnum.alert + current_segment.last_alert_time = frame_time elif ( topic == DetectionTypeEnum.lpr and self.config.cameras[camera].review.detections.enabled @@ -725,7 +728,8 @@ def run(self) -> None: ): if ( self.config.cameras[camera].review.detections.enabled - and manual_info["label"].split(': ')[0] in self.config.cameras[camera].review.detections.labels + and manual_info["label"].split(": ")[0] + in self.config.cameras[camera].review.detections.labels ): current_segment.severity = SeverityEnum.detection else: @@ -804,10 +808,12 @@ def run(self) -> None: severity = None if ( self.config.cameras[camera].review.detections.enabled - and manual_info["label"].split(': ')[0] in self.config.cameras[camera].review.detections.labels + and manual_info["label"].split(": ")[0] + in self.config.cameras[camera].review.detections.labels ): severity = SeverityEnum.detection - if (self.config.cameras[camera].review.alerts.enabled + if ( + self.config.cameras[camera].review.alerts.enabled and not severity ): severity = SeverityEnum.alert From 19c837e8a49ae4e81e8f98104e1e7a335aedca12 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:43:59 -0500 Subject: [PATCH 03/18] api-detection testing --- frigate/review/maintainer.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index 1d3ad886bf..931e551cae 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -700,15 +700,11 @@ def run(self) -> None: and self.config.cameras[camera].review.alerts.enabled ): if ( - self.config.cameras[camera].review.detections.enabled - and manual_info["label"].split(": ")[0] - in self.config.cameras[camera].review.detections.labels + not self.config.cameras[camera].review.detections.enabled + or manual_info["label"].split(": ")[0] + not in self.config.cameras[camera].review.detections.labels ): - # current_segment.severity = SeverityEnum.detection - current_segment.last_detection_time = frame_time - else: - # current_segment.severity = SeverityEnum.alert - current_segment.last_alert_time = frame_time + current_segment.severity = SeverityEnum.alert elif ( topic == DetectionTypeEnum.lpr and self.config.cameras[camera].review.detections.enabled @@ -727,12 +723,10 @@ def run(self) -> None: and self.config.cameras[camera].review.alerts.enabled ): if ( - self.config.cameras[camera].review.detections.enabled - and manual_info["label"].split(": ")[0] - in self.config.cameras[camera].review.detections.labels + not self.config.cameras[camera].review.detections.enabled + or manual_info["label"].split(": ")[0] + not in self.config.cameras[camera].review.detections.labels ): - current_segment.severity = SeverityEnum.detection - else: current_segment.severity = SeverityEnum.alert elif ( topic == DetectionTypeEnum.lpr From 932899cdaa20b999ff7ce1130c5e2b4e1bef0db5 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:57:12 -0500 Subject: [PATCH 04/18] api detections testing --- frigate/review/maintainer.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index 931e551cae..b98707c47e 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -700,17 +700,20 @@ def run(self) -> None: and self.config.cameras[camera].review.alerts.enabled ): if ( - not self.config.cameras[camera].review.detections.enabled - or manual_info["label"].split(": ")[0] - not in self.config.cameras[camera].review.detections.labels + self.config.cameras[camera].review.detections.enabled + and manual_info["label"].split(": ")[0] + in self.config.cameras[camera].review.detections.labels ): + current_segment.last_detection_time = manual_info["end_time"] + else: current_segment.severity = SeverityEnum.alert + current_segment.last_alert_time = manual_info["end_time"] elif ( topic == DetectionTypeEnum.lpr and self.config.cameras[camera].review.detections.enabled ): current_segment.severity = SeverityEnum.detection - current_segment.last_alert_time = manual_info["end_time"] + current_segment.last_alert_time = manual_info["end_time"] elif manual_info["state"] == ManualEventState.start: self.indefinite_events[camera][manual_info["event_id"]] = ( manual_info["label"] From 1e041355be85926ee81d99d98c27a7d049baa859 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Thu, 22 Jan 2026 12:11:32 -0500 Subject: [PATCH 05/18] precapture offset is unnecessary for manual events --- frigate/track/object_processing.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frigate/track/object_processing.py b/frigate/track/object_processing.py index e0ee74228a..83b72d6612 100644 --- a/frigate/track/object_processing.py +++ b/frigate/track/object_processing.py @@ -536,8 +536,7 @@ def create_manual_event(self, payload: tuple) -> None: "sub_label": sub_label, "score": score, "camera": camera_name, - "start_time": frame_time - - self.config.cameras[camera_name].record.event_pre_capture, + "start_time": frame_time, "end_time": end_time, "has_clip": self.config.cameras[camera_name].record.enabled and include_recording, From 5240f47ec88f454df96680ca9c497d4e030cddb3 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Fri, 23 Jan 2026 14:04:51 -0500 Subject: [PATCH 06/18] api detections testing --- frigate/review/maintainer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index b98707c47e..75b298a7b7 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -809,9 +809,8 @@ def run(self) -> None: in self.config.cameras[camera].review.detections.labels ): severity = SeverityEnum.detection - if ( + elif ( self.config.cameras[camera].review.alerts.enabled - and not severity ): severity = SeverityEnum.alert From 562dfee7760063dcd9fc4ad1cd06765c09487c9f Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 10:35:42 -0500 Subject: [PATCH 07/18] Debug API detections --- frigate/review/maintainer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index 75b298a7b7..e691782368 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -803,6 +803,7 @@ def run(self) -> None: ) elif topic == DetectionTypeEnum.api: severity = None + print("API Detection: " + str(manual_info)) if ( self.config.cameras[camera].review.detections.enabled and manual_info["label"].split(": ")[0] From 38ddc4836193bf6d3958d6136c864679339b70b5 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 11:21:42 -0500 Subject: [PATCH 08/18] api detection debugging --- frigate/review/maintainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index e691782368..39e10516fd 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -803,7 +803,7 @@ def run(self) -> None: ) elif topic == DetectionTypeEnum.api: severity = None - print("API Detection: " + str(manual_info)) + logger.info("API Detection: " + str(manual_info)) if ( self.config.cameras[camera].review.detections.enabled and manual_info["label"].split(": ")[0] From db60398fbba026f2ec95c8c8542de4027eca6393 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 14:00:23 -0500 Subject: [PATCH 09/18] api detections debugging --- frigate/review/maintainer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index 39e10516fd..c677515b52 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -380,6 +380,7 @@ def update_existing_segment( objects: list[TrackedObject], ) -> None: """Validate if existing review segment should continue.""" + logger.info("Updating existing segment") camera_config = self.config.cameras[segment.camera] # get active objects + objects loitering in loitering zones @@ -399,12 +400,14 @@ def update_existing_segment( if segment.severity != SeverityEnum.alert: # if segment is not alert category but current activity is # update this segment to be an alert + logger.info("Updating existing segment to be an Alert") segment.severity = SeverityEnum.alert should_update_state = True should_update_image = True if activity.has_activity_category(SeverityEnum.detection): segment.last_detection_time = frame_time + logger.info("Updating last detection frame time: " + str(segment.last_detection_time)) for object in activity.get_all_objects(): # Alert-level objects should always be added (they extend/upgrade the segment) @@ -418,6 +421,7 @@ def update_existing_segment( # This is a detection-level object # Only add if it started during the alert's active period if object["start_time"] > segment.last_alert_time: + logger.info("Detection object extending alert segment") continue if not object["sub_label"]: @@ -701,6 +705,7 @@ def run(self) -> None: ): if ( self.config.cameras[camera].review.detections.enabled + and "label" in manual_info and manual_info["label"].split(": ")[0] in self.config.cameras[camera].review.detections.labels ): @@ -727,6 +732,7 @@ def run(self) -> None: ): if ( not self.config.cameras[camera].review.detections.enabled + or "label" not in manual_info or manual_info["label"].split(": ")[0] not in self.config.cameras[camera].review.detections.labels ): @@ -806,6 +812,7 @@ def run(self) -> None: logger.info("API Detection: " + str(manual_info)) if ( self.config.cameras[camera].review.detections.enabled + and "label" in manual_info and manual_info["label"].split(": ")[0] in self.config.cameras[camera].review.detections.labels ): From e9c49e4ed23dafb2a6eeedf0705f768938b9c005 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 14:40:47 -0500 Subject: [PATCH 10/18] api detections debugging Log categorized objects when retrieving all objects. --- frigate/review/maintainer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index c677515b52..b44b10dd08 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -251,6 +251,7 @@ def has_activity_category(self, severity: SeverityEnum) -> bool: return False def get_all_objects(self) -> list[TrackedObject]: + logger.info("All Objects: " + str(self.categorized_objects["alerts"] + self.categorized_objects["detections"])) return ( self.categorized_objects["alerts"] + self.categorized_objects["detections"] ) From 0331fe9c8c9d35215f7863316f85fa2608dfb8ce Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 15:22:17 -0500 Subject: [PATCH 11/18] api detections debugging --- frigate/review/maintainer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index b44b10dd08..5b06f5e701 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -177,23 +177,28 @@ def __init__( } for o in all_objects: + logger.info("o in all_objects: " + str(o)) if ( o["motionless_count"] >= camera_config.detect.stationary.threshold and not o["pending_loitering"] ): # no stationary objects unless loitering + logger.info("Skipping due to 1: " + str(o)) continue if o["position_changes"] == 0: # object must have moved at least once + logger.info("Skipping due to 2: " + str(o)) continue if o["frame_time"] != frame_time: # object must be detected in this frame + logger.info("Skipping due to 3: " + str(o)) continue if o["false_positive"]: # object must not be a false positive + logger.info("Skipping due to 4: " + str(o)) continue if ( From 6e42da23c4fcf179382756b429fcc4a234eec8b4 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 16:28:53 -0500 Subject: [PATCH 12/18] api detections debugging --- frigate/review/{maintainer.py => updating} | 2 ++ 1 file changed, 2 insertions(+) rename frigate/review/{maintainer.py => updating} (99%) diff --git a/frigate/review/maintainer.py b/frigate/review/updating similarity index 99% rename from frigate/review/maintainer.py rename to frigate/review/updating index 5b06f5e701..fe79f73cd2 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/updating @@ -389,6 +389,8 @@ def update_existing_segment( logger.info("Updating existing segment") camera_config = self.config.cameras[segment.camera] + logger.info("Segment Detections: " + str(segment.detections)) + # get active objects + objects loitering in loitering zones activity = ActiveObjects(frame_time, camera_config, objects) prev_data = segment.get_data(False) From bff1b4d42eda689e5715ac2dfaae42bb226ac657 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 16:38:56 -0500 Subject: [PATCH 13/18] typo --- frigate/review/{updating => maintainer.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frigate/review/{updating => maintainer.py} (100%) diff --git a/frigate/review/updating b/frigate/review/maintainer.py similarity index 100% rename from frigate/review/updating rename to frigate/review/maintainer.py From e24a227758a5d5c89e50eedb3b87db172bddd212 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 17:09:30 -0500 Subject: [PATCH 14/18] api-detections debugging --- frigate/review/maintainer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index fe79f73cd2..8b84399949 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -476,6 +476,10 @@ def update_existing_segment( self.frame_manager.close(frame_name) except FileNotFoundError: return + # indefinite (manual) events should extend the segment + if len(self.indefinite_events[segment.camera]) > 0: + has_activity = True + segment.last_detection_time = frame_time if not has_activity: if not segment.has_frame: @@ -818,6 +822,7 @@ def run(self) -> None: elif topic == DetectionTypeEnum.api: severity = None logger.info("API Detection: " + str(manual_info)) + logger.info("Manual Event State: " + str(manual_info["state"]) if ( self.config.cameras[camera].review.detections.enabled and "label" in manual_info @@ -830,7 +835,7 @@ def run(self) -> None: ): severity = SeverityEnum.alert - if severity: + if severity and manual_info["state"] != ManualEventState.end: self.active_review_segments[camera] = PendingReviewSegment( camera, frame_time, From df96d1cb20098aab0a7623031d5d7e94a4dfcf76 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 17:19:26 -0500 Subject: [PATCH 15/18] typo --- frigate/review/maintainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index 8b84399949..b6136463e2 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -822,7 +822,7 @@ def run(self) -> None: elif topic == DetectionTypeEnum.api: severity = None logger.info("API Detection: " + str(manual_info)) - logger.info("Manual Event State: " + str(manual_info["state"]) + logger.info("Manual Event State: " + str(manual_info["state"])) if ( self.config.cameras[camera].review.detections.enabled and "label" in manual_info From ec5ee4f21a86cefe59d547387b892d7ce3fbc0cd Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 18:09:29 -0500 Subject: [PATCH 16/18] debug cleanup Removed unnecessary logging statements to clean up the code. --- frigate/review/maintainer.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index b6136463e2..6c92ba5f45 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -177,28 +177,23 @@ def __init__( } for o in all_objects: - logger.info("o in all_objects: " + str(o)) if ( o["motionless_count"] >= camera_config.detect.stationary.threshold and not o["pending_loitering"] ): # no stationary objects unless loitering - logger.info("Skipping due to 1: " + str(o)) continue if o["position_changes"] == 0: # object must have moved at least once - logger.info("Skipping due to 2: " + str(o)) continue if o["frame_time"] != frame_time: # object must be detected in this frame - logger.info("Skipping due to 3: " + str(o)) continue if o["false_positive"]: # object must not be a false positive - logger.info("Skipping due to 4: " + str(o)) continue if ( @@ -256,7 +251,6 @@ def has_activity_category(self, severity: SeverityEnum) -> bool: return False def get_all_objects(self) -> list[TrackedObject]: - logger.info("All Objects: " + str(self.categorized_objects["alerts"] + self.categorized_objects["detections"])) return ( self.categorized_objects["alerts"] + self.categorized_objects["detections"] ) @@ -386,11 +380,8 @@ def update_existing_segment( objects: list[TrackedObject], ) -> None: """Validate if existing review segment should continue.""" - logger.info("Updating existing segment") camera_config = self.config.cameras[segment.camera] - logger.info("Segment Detections: " + str(segment.detections)) - # get active objects + objects loitering in loitering zones activity = ActiveObjects(frame_time, camera_config, objects) prev_data = segment.get_data(False) @@ -408,14 +399,12 @@ def update_existing_segment( if segment.severity != SeverityEnum.alert: # if segment is not alert category but current activity is # update this segment to be an alert - logger.info("Updating existing segment to be an Alert") segment.severity = SeverityEnum.alert should_update_state = True should_update_image = True if activity.has_activity_category(SeverityEnum.detection): segment.last_detection_time = frame_time - logger.info("Updating last detection frame time: " + str(segment.last_detection_time)) for object in activity.get_all_objects(): # Alert-level objects should always be added (they extend/upgrade the segment) @@ -429,7 +418,6 @@ def update_existing_segment( # This is a detection-level object # Only add if it started during the alert's active period if object["start_time"] > segment.last_alert_time: - logger.info("Detection object extending alert segment") continue if not object["sub_label"]: @@ -476,10 +464,9 @@ def update_existing_segment( self.frame_manager.close(frame_name) except FileNotFoundError: return - # indefinite (manual) events should extend the segment + # indefinite (manual) events should extend the segment until they end if len(self.indefinite_events[segment.camera]) > 0: has_activity = True - segment.last_detection_time = frame_time if not has_activity: if not segment.has_frame: @@ -821,8 +808,6 @@ def run(self) -> None: ) elif topic == DetectionTypeEnum.api: severity = None - logger.info("API Detection: " + str(manual_info)) - logger.info("Manual Event State: " + str(manual_info["state"])) if ( self.config.cameras[camera].review.detections.enabled and "label" in manual_info @@ -835,7 +820,7 @@ def run(self) -> None: ): severity = SeverityEnum.alert - if severity and manual_info["state"] != ManualEventState.end: + if severity: self.active_review_segments[camera] = PendingReviewSegment( camera, frame_time, From 4986e242a5d0bc557a78f01de89db96a3d7198b6 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Sun, 25 Jan 2026 18:18:38 -0500 Subject: [PATCH 17/18] api detections fixes --- frigate/review/maintainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index 6c92ba5f45..df9c8d6095 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -465,7 +465,7 @@ def update_existing_segment( except FileNotFoundError: return # indefinite (manual) events should extend the segment until they end - if len(self.indefinite_events[segment.camera]) > 0: + if segment.camera in self.indefinite_events and len(self.indefinite_events[segment.camera]) > 0: has_activity = True if not has_activity: From e0956233946b92c32ac55e917f84af3a91738e33 Mon Sep 17 00:00:00 2001 From: nulledy <254504350+nulledy@users.noreply.github.com> Date: Mon, 26 Jan 2026 12:03:33 -0500 Subject: [PATCH 18/18] formatting and cleanup Refactor conditional checks for clarity and consistency in maintainer.py. --- frigate/review/maintainer.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.py index df9c8d6095..35a7e1708b 100644 --- a/frigate/review/maintainer.py +++ b/frigate/review/maintainer.py @@ -465,7 +465,10 @@ def update_existing_segment( except FileNotFoundError: return # indefinite (manual) events should extend the segment until they end - if segment.camera in self.indefinite_events and len(self.indefinite_events[segment.camera]) > 0: + if ( + segment.camera in self.indefinite_events + and len(self.indefinite_events[segment.camera]) > 0 + ): has_activity = True if not has_activity: @@ -704,14 +707,17 @@ def run(self) -> None: ): if ( self.config.cameras[camera].review.detections.enabled - and "label" in manual_info and manual_info["label"].split(": ")[0] in self.config.cameras[camera].review.detections.labels ): - current_segment.last_detection_time = manual_info["end_time"] + current_segment.last_detection_time = manual_info[ + "end_time" + ] else: current_segment.severity = SeverityEnum.alert - current_segment.last_alert_time = manual_info["end_time"] + current_segment.last_alert_time = manual_info[ + "end_time" + ] elif ( topic == DetectionTypeEnum.lpr and self.config.cameras[camera].review.detections.enabled @@ -730,10 +736,13 @@ def run(self) -> None: and self.config.cameras[camera].review.alerts.enabled ): if ( - not self.config.cameras[camera].review.detections.enabled - or "label" not in manual_info + not self.config.cameras[ + camera + ].review.detections.enabled or manual_info["label"].split(": ")[0] - not in self.config.cameras[camera].review.detections.labels + not in self.config.cameras[ + camera + ].review.detections.labels ): current_segment.severity = SeverityEnum.alert elif ( @@ -810,14 +819,11 @@ def run(self) -> None: severity = None if ( self.config.cameras[camera].review.detections.enabled - and "label" in manual_info and manual_info["label"].split(": ")[0] in self.config.cameras[camera].review.detections.labels ): severity = SeverityEnum.detection - elif ( - self.config.cameras[camera].review.alerts.enabled - ): + elif self.config.cameras[camera].review.alerts.enabled: severity = SeverityEnum.alert if severity: