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) now - detection.get("last_detection", now)
> self.config.audio.max_not_heard > self.config.audio.max_not_heard
): ):
self.detections[detection["label"]] = None
requests.put( requests.put(
f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end", f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end",
json={ json={
@ -217,6 +216,7 @@ class AudioEventMaintainer(threading.Thread):
+ self.config.record.events.post_capture + self.config.record.events.post_capture
}, },
) )
self.detections[detection["label"]] = None
def restart_audio_pipe(self) -> None: def restart_audio_pipe(self) -> None:
try: try:

View File

@ -239,6 +239,6 @@ class EventProcessor(threading.Thread):
} }
try: try:
Event.update(event).execute() Event.update(event).where(Event.id == event_data["id"]).execute()
except Exception: except Exception as e:
logger.warning(f"Failed to update manual event: {event_data['id']}") logger.warning(f"Failed to update manual event: {event_data['id']} :: {e}")