From b2e05afff2aae51a79a9390c47722b8d60fffb88 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Fri, 15 Oct 2021 21:56:03 -0500 Subject: [PATCH] prevent oldest recording from being deleted --- frigate/record.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frigate/record.py b/frigate/record.py index 45480a787..b26551c9c 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -294,7 +294,8 @@ class RecordingCleanup(threading.Thread): Recordings.select().order_by(Recordings.start_time.desc()).get() ) - oldest_timestamp = oldest_recording.start_time + p = Path(oldest_recording.path) + oldest_timestamp = p.stat().st_mtime - 1 except DoesNotExist: oldest_timestamp = datetime.datetime.now().timestamp()