Keep post capture after review items end (#24726)

* keep post capture segments after a review item ends

The recording maintainer only loaded review items whose end_time was after the oldest cached segment, so once an item closed in the database the segments in its post_capture window no longer matched it. With continuous recording off and no motion after the item, everything past roughly the review cutoff_time was deleted from the cache instead of being kept for the full post_capture. The query bound now subtracts the camera's largest post_capture, and the per-item check still decides the exact cutoff.

* fix mypy and add docstring
This commit is contained in:
Josh Hawkins
2026-10-23 06:25:21 -06:00
committed by GitHub
parent a85526187e
commit 6e185ed36e
3 changed files with 69 additions and 3 deletions
+8
View File
@@ -224,6 +224,14 @@ class RecordConfig(FrigateBaseModel):
self.detections.pre_capture,
)
@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,
)
def get_review_pre_capture(self, severity: SeverityEnum) -> int:
if severity == SeverityEnum.alert:
return self.alerts.pre_capture