Add ability to filter Explore by Frigate+ submission status (#14909)

* backend

* add is_submitted to query params

* add submitted filter to dialog

* allow is_submitted filter selection with input
This commit is contained in:
Josh Hawkins
2024-11-10 16:57:11 -06:00
committed by GitHub
parent c1bfc1df67
commit 0829517b72
7 changed files with 135 additions and 13 deletions
+7
View File
@@ -360,6 +360,7 @@ def events_search(request: Request, params: EventsSearchQueryParams = Depends())
time_range = params.time_range
has_clip = params.has_clip
has_snapshot = params.has_snapshot
is_submitted = params.is_submitted
# for similarity search
event_id = params.event_id
@@ -441,6 +442,12 @@ def events_search(request: Request, params: EventsSearchQueryParams = Depends())
if has_snapshot is not None:
event_filters.append((Event.has_snapshot == has_snapshot))
if is_submitted is not None:
if is_submitted == 0:
event_filters.append((Event.plus_id.is_null()))
elif is_submitted > 0:
event_filters.append((Event.plus_id != ""))
if min_score is not None and max_score is not None:
event_filters.append((Event.data["score"].between(min_score, max_score)))
else: