From 016ade809ea5c9148ea0bdc8647b516b8ea5ec63 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Sat, 1 Jul 2023 15:15:15 -0600 Subject: [PATCH] Fix audio events not being ended correctly --- frigate/events/audio.py | 2 +- frigate/events/maintainer.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frigate/events/audio.py b/frigate/events/audio.py index b0c55c3a3..164c9c62d 100644 --- a/frigate/events/audio.py +++ b/frigate/events/audio.py @@ -209,7 +209,6 @@ class AudioEventMaintainer(threading.Thread): now - detection.get("last_detection", now) > self.config.audio.max_not_heard ): - self.detections[detection["label"]] = None requests.put( f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end", json={ @@ -217,6 +216,7 @@ class AudioEventMaintainer(threading.Thread): + self.config.record.events.post_capture }, ) + self.detections[detection["label"]] = None def restart_audio_pipe(self) -> None: try: diff --git a/frigate/events/maintainer.py b/frigate/events/maintainer.py index f024f0be6..0b2612f4f 100644 --- a/frigate/events/maintainer.py +++ b/frigate/events/maintainer.py @@ -239,6 +239,6 @@ class EventProcessor(threading.Thread): } try: - Event.update(event).execute() - except Exception: - logger.warning(f"Failed to update manual event: {event_data['id']}") + Event.update(event).where(Event.id == event_data["id"]).execute() + except Exception as e: + logger.warning(f"Failed to update manual event: {event_data['id']} :: {e}")