From d1d0039689814b9a0ea9f91f4ca00ae95d8b7799 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 9 Dec 2024 08:12:20 -0700 Subject: [PATCH] Don't catch detections --- frigate/events/cleanup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frigate/events/cleanup.py b/frigate/events/cleanup.py index bb2a6f5577..b1b485c3d2 100644 --- a/frigate/events/cleanup.py +++ b/frigate/events/cleanup.py @@ -298,7 +298,13 @@ def expire_clips(self) -> list[str]: .where( Event.camera == name, Event.retain_indefinitely == False, - (Event.end_time < alert_expire_date) + ( + ( + (Event.data["max_severity"] != "detection") + | (Event.data["max_severity"].is_null()) + ) + & (Event.end_time < alert_expire_date) + ) | ( (Event.data["max_severity"] == "detection") & (Event.end_time < detection_expire_date)