From bbdf5e1bee62df671be91a01f1ab579b3508a262 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 1 Sep 2023 06:02:35 -0600 Subject: [PATCH] Don't count in progress events as duplicates (#7568) * Don't count in progress events as duplicates * Fix sql --- frigate/events/cleanup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frigate/events/cleanup.py b/frigate/events/cleanup.py index d70a290d7..793e01293 100644 --- a/frigate/events/cleanup.py +++ b/frigate/events/cleanup.py @@ -168,6 +168,7 @@ class EventCleanup(threading.Thread): camera, has_snapshot, has_clip, + end_time, row_number() over ( partition by label, camera, round(start_time/5,0)*5 order by end_time-start_time desc @@ -176,7 +177,7 @@ class EventCleanup(threading.Thread): ) select distinct id, camera, has_snapshot, has_clip from grouped_events - where copy_number > 1;""" + where copy_number > 1 and end_time not null;""" duplicate_events = Event.raw(duplicate_query) for event in duplicate_events: