mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25:22 +03:00
Add event filtering for sub label
This commit is contained in:
parent
191de73126
commit
df22a00a5c
@ -5,6 +5,7 @@ import copy
|
||||
import json
|
||||
import glob
|
||||
import logging
|
||||
from operator import sub
|
||||
import os
|
||||
import re
|
||||
import subprocess as sp
|
||||
@ -496,6 +497,7 @@ def events():
|
||||
limit = request.args.get("limit", 100)
|
||||
camera = request.args.get("camera", "all")
|
||||
label = request.args.get("label", "all")
|
||||
sub_label = request.args.get("sub_label", "all")
|
||||
zone = request.args.get("zone", "all")
|
||||
after = request.args.get("after", type=float)
|
||||
before = request.args.get("before", type=float)
|
||||
@ -512,6 +514,9 @@ def events():
|
||||
if label != "all":
|
||||
clauses.append((Event.label == label))
|
||||
|
||||
if sub_label != "all":
|
||||
clauses.append((Event.sub_label == sub_label))
|
||||
|
||||
if zone != "all":
|
||||
clauses.append((Event.zones.cast("text") % f'*"{zone}"*'))
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user