From c02d737c956d3cd8c40224fa0e6a3542d46947fa Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 30 May 2025 13:45:32 -0600 Subject: [PATCH] Fix preview query --- frigate/record/cleanup.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/frigate/record/cleanup.py b/frigate/record/cleanup.py index aadd4aa7f..b73b31f7e 100644 --- a/frigate/record/cleanup.py +++ b/frigate/record/cleanup.py @@ -206,14 +206,9 @@ class RecordingCleanup(threading.Thread): Previews.path, ) .where( - (Recordings.camera == config.name) - & ( - ( - (Recordings.end_time < continuous_expire_date) - & (Recordings.motion == 0) - ) - | (Recordings.end_time < motion_expire_date) - ) + (Previews.camera == config.name) + & (Previews.end_time < continuous_expire_date) + & (Previews.end_time < motion_expire_date) ) .order_by(Previews.start_time) .namedtuples()