mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 03:35:26 +03:00
Added filter for submitted events
This commit is contained in:
parent
4b2eb2083d
commit
a93eb21fab
@ -155,22 +155,23 @@ Version info
|
|||||||
|
|
||||||
Events from the database. Accepts the following query string parameters:
|
Events from the database. Accepts the following query string parameters:
|
||||||
|
|
||||||
| param | Type | Description |
|
| param | Type | Description |
|
||||||
| -------------------- | ----- | ----------------------------------------------- |
|
| -------------------- | ----- | ----------------------------------------------------- |
|
||||||
| `before` | int | Epoch time |
|
| `before` | int | Epoch time |
|
||||||
| `after` | int | Epoch time |
|
| `after` | int | Epoch time |
|
||||||
| `cameras` | str | , separated list of cameras |
|
| `cameras` | str | , separated list of cameras |
|
||||||
| `labels` | str | , separated list of labels |
|
| `labels` | str | , separated list of labels |
|
||||||
| `zones` | str | , separated list of zones |
|
| `zones` | str | , separated list of zones |
|
||||||
| `limit` | int | Limit the number of events returned |
|
| `limit` | int | Limit the number of events returned |
|
||||||
| `has_snapshot` | int | Filter to events that have snapshots (0 or 1) |
|
| `has_snapshot` | int | Filter to events that have snapshots (0 or 1) |
|
||||||
| `has_clip` | int | Filter to events that have clips (0 or 1) |
|
| `has_clip` | int | Filter to events that have clips (0 or 1) |
|
||||||
| `include_thumbnails` | int | Include thumbnails in the response (0 or 1) |
|
| `include_thumbnails` | int | Include thumbnails in the response (0 or 1) |
|
||||||
| `in_progress` | int | Limit to events in progress (0 or 1) |
|
| `in_progress` | int | Limit to events in progress (0 or 1) |
|
||||||
| `time_range` | str | Time range in format after,before (00:00,24:00) |
|
| `time_range` | str | Time range in format after,before (00:00,24:00) |
|
||||||
| `timezone` | str | Timezone to use for time range |
|
| `timezone` | str | Timezone to use for time range |
|
||||||
| `min_score` | float | Minimum score of the event |
|
| `min_score` | float | Minimum score of the event |
|
||||||
| `max_score` | float | Maximum 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) |
|
||||||
|
|
||||||
### `GET /api/timeline`
|
### `GET /api/timeline`
|
||||||
|
|
||||||
|
|||||||
@ -779,6 +779,7 @@ def events():
|
|||||||
favorites = request.args.get("favorites", type=int)
|
favorites = request.args.get("favorites", type=int)
|
||||||
min_score = request.args.get("min_score", type=float)
|
min_score = request.args.get("min_score", type=float)
|
||||||
max_score = request.args.get("max_score", type=float)
|
max_score = request.args.get("max_score", type=float)
|
||||||
|
is_submitted = request.args.get("is_submitted", type=int)
|
||||||
|
|
||||||
clauses = []
|
clauses = []
|
||||||
|
|
||||||
@ -907,6 +908,12 @@ def events():
|
|||||||
if min_score is not None:
|
if min_score is not None:
|
||||||
clauses.append((Event.data["score"] >= min_score))
|
clauses.append((Event.data["score"] >= min_score))
|
||||||
|
|
||||||
|
if is_submitted is not None:
|
||||||
|
if is_submitted == 0:
|
||||||
|
clauses.append((Event.plus_id.is_null()))
|
||||||
|
else:
|
||||||
|
clauses.append((Event.plus_id != ""))
|
||||||
|
|
||||||
if len(clauses) == 0:
|
if len(clauses) == 0:
|
||||||
clauses.append((True))
|
clauses.append((True))
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user