From d6a00938007db25d87f038b64c22c3e325a86183 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 5 May 2026 18:56:03 -0500 Subject: [PATCH] use continuous expire date when loading reviews for recording cleanup --- frigate/record/cleanup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frigate/record/cleanup.py b/frigate/record/cleanup.py index e41a5bf39..71097f1d9 100644 --- a/frigate/record/cleanup.py +++ b/frigate/record/cleanup.py @@ -351,9 +351,11 @@ class RecordingCleanup(threading.Thread): ) .where( ReviewSegment.camera == camera, - # need to ensure segments for all reviews starting - # before the expire date are included - ReviewSegment.start_time < motion_expire_date, + # candidate recordings can extend up to continuous_expire_date + # (the no-motion no-audio branch of the recordings query), + # so reviews must cover that full range to avoid deleting + # segments that overlap recent alerts/detections. + ReviewSegment.start_time < continuous_expire_date, ) .order_by(ReviewSegment.start_time) .namedtuples()