NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
API enhancements (#8107)
tpjanssena82334ca1cd5
diff --git a/docs/docs/integrations/api.md b/docs/docs/integrations/api.mdindex 27b760cab6..7ddc773c32 100644--- a/docs/docs/integrations/api.md+++ b/docs/docs/integrations/api.md@@ -172,6 +172,8 @@ Events from the database. Accepts the following query string parameters:| `min_score` | float | Minimum score of the event || `max_score` | float | Maximum score of the event || `is_submitted` | int | Filter events that are submitted to Frigate+ (0 or 1) |+| `min_length` | float | Minimum length of the event |+| `max_length` | float | Maximum length of the event |### `GET /api/timeline`diff --git a/frigate/http.py b/frigate/http.pyindex 3098285ccf..64ba51ea07 100644--- a/frigate/http.py+++ b/frigate/http.py@@ -805,6 +805,8 @@ def events():min_score = request.args.get("min_score", type=float)max_score = request.args.get("max_score", type=float)is_submitted = request.args.get("is_submitted", type=int)+ min_length = request.args.get("min_length", type=float)+ max_length = request.args.get("max_length", type=float)clauses = []@@ -933,6 +935,12 @@ def events():if min_score is not None:clauses.append((Event.data["score"] >= min_score))+ if min_length is not None:+ clauses.append(((Event.end_time - Event.start_time) >= min_length))++ if max_length is not None:+ clauses.append(((Event.end_time - Event.start_time) <= max_length))+if is_submitted is not None:if is_submitted == 0:clauses.append((Event.plus_id.is_null()))