From 76ba6a973c42dc99cbbba62d5911a4cd15173132 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Fri, 14 Jul 2023 07:44:53 -0600 Subject: [PATCH] Fix check --- frigate/app.py | 9 +++++---- frigate/record/maintainer.py | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frigate/app.py b/frigate/app.py index b857edf25..6296134eb 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -677,7 +677,8 @@ class FrigateApp: self.log_queue, self.inter_process_queue, ]: - while queue and not queue.empty(): - queue.get_nowait() - queue.close() - queue.join_thread() + if queue is not None: + while not queue.empty(): + queue.get_nowait() + queue.close() + queue.join_thread() diff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.py index 1a992b823..21173cfa5 100644 --- a/frigate/record/maintainer.py +++ b/frigate/record/maintainer.py @@ -287,7 +287,9 @@ class RecordingMaintainer(threading.Thread): # check if the segment shouldn't be stored if ( (store_mode == RetainModeEnum.motion and motion_count == 0) - or (store_mode == RetainModeEnum.motion and averageDBFS > 0) + or ( + store_mode == RetainModeEnum.motion and averageDBFS < 0 + ) # dBFS is stored in a negative scale or (store_mode == RetainModeEnum.active_objects and active_count == 0) ): Path(cache_path).unlink(missing_ok=True)