Fix audio events not being ended correctly

This commit is contained in:
Nick Mowen 2023-07-01 15:15:15 -06:00
parent ad3d43f0b1
commit 016ade809e
2 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

@ -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}")