diff --git a/frigate/config/camera/record.py b/frigate/config/camera/record.py index 8d6980942c..ebb51d5b37 100644 --- a/frigate/config/camera/record.py +++ b/frigate/config/camera/record.py @@ -226,6 +226,7 @@ class RecordConfig(FrigateBaseModel): @property def event_post_capture(self) -> int: + """Largest post-capture window used to fetch candidate reviews.""" return max( self.alerts.post_capture, self.detections.post_capture, diff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.py index 8a5a3cc236..4bcf8a4b48 100644 --- a/frigate/record/maintainer.py +++ b/frigate/record/maintainer.py @@ -474,9 +474,10 @@ class RecordingMaintainer(threading.Thread): # get all reviews whose post capture reaches the oldest cache file # or with end_time None; shared across stream types if camera not in reviews_by_camera: - camera_config = self.config.cameras.get(camera) post_capture = ( - camera_config.record.event_post_capture if camera_config else 0 + self.config.cameras[camera].record.event_post_capture + if camera in self.config.cameras + else 0 ) reviews_by_camera[camera] = ( ReviewSegment.select(