mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01:00
Fix audio events not being ended (#6981)
* Fix audio events not being ended * Fix audio events not being ended correctly * Clean up debug code
This commit is contained in:
parent
7ee17c7af8
commit
c25367221e
@ -202,11 +202,13 @@ class AudioEventMaintainer(threading.Thread):
|
||||
now = datetime.datetime.now().timestamp()
|
||||
|
||||
for detection in self.detections.values():
|
||||
if not detection:
|
||||
continue
|
||||
|
||||
if (
|
||||
now - detection.get("last_detection", now)
|
||||
> self.config.audio.max_not_heard
|
||||
):
|
||||
del self.detections[detection["label"]]
|
||||
requests.put(
|
||||
f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end",
|
||||
json={
|
||||
@ -214,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:
|
||||
|
@ -239,6 +239,6 @@ class EventProcessor(threading.Thread):
|
||||
}
|
||||
|
||||
try:
|
||||
Event.update(event).execute()
|
||||
Event.update(event).where(Event.id == event_data["id"]).execute()
|
||||
except Exception:
|
||||
logger.warning(f"Failed to update manual event: {event_data['id']}")
|
||||
|
Loading…
Reference in New Issue
Block a user