From 014e6fc909bc8baba91274ba3dc595e9e9d2b608 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sun, 21 Nov 2021 09:43:37 -0600 Subject: [PATCH] ensure cache copies when events have ended --- frigate/record.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frigate/record.py b/frigate/record.py index 06e3108ef..91024317b 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -110,7 +110,7 @@ class RecordingMaintainer(threading.Thread): .where( Event.camera == camera, (Event.end_time == None) - | (Event.end_time >= recordings[0]["start_time"]), + | (Event.end_time >= recordings[0]["start_time"].timestamp()), Event.has_clip, ) .order_by(Event.start_time) @@ -171,7 +171,10 @@ class RecordingMaintainer(threading.Thread): # if the event is in progress or ends after the recording starts, keep it # and stop looking at events - if event.end_time is None or event.end_time >= start_time: + if ( + event.end_time is None + or event.end_time >= start_time.timestamp() + ): overlaps = True break