From df22a00a5c932a5a61de44633958999f645f8c77 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Thu, 5 May 2022 22:13:29 -0600 Subject: [PATCH] Add event filtering for sub label --- frigate/http.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frigate/http.py b/frigate/http.py index 70eb179ae..32aebe1d7 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -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}"*'))