mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-23 22:07:07 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user