use continuous expire date when loading reviews for recording cleanup

This commit is contained in:
Josh Hawkins 2026-05-05 18:56:03 -05:00
parent 882b3a8ffd
commit d6a0093800

View File

@ -351,9 +351,11 @@ class RecordingCleanup(threading.Thread):
) )
.where( .where(
ReviewSegment.camera == camera, ReviewSegment.camera == camera,
# need to ensure segments for all reviews starting # candidate recordings can extend up to continuous_expire_date
# before the expire date are included # (the no-motion no-audio branch of the recordings query),
ReviewSegment.start_time < motion_expire_date, # 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) .order_by(ReviewSegment.start_time)
.namedtuples() .namedtuples()