mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25:22 +03:00
Add endpoint to get list of sub labels inside DB
This commit is contained in:
parent
970e6b0174
commit
103073b587
@ -11,6 +11,7 @@ import subprocess as sp
|
||||
import time
|
||||
from functools import reduce
|
||||
from pathlib import Path
|
||||
from certifi import where
|
||||
|
||||
import cv2
|
||||
from flask.helpers import send_file
|
||||
@ -586,6 +587,20 @@ def mjpeg_feed(camera_name):
|
||||
return "Camera named {} not found".format(camera_name), 404
|
||||
|
||||
|
||||
@bp.route("/sub_labels")
|
||||
def get_sub_labels():
|
||||
try:
|
||||
sub_labels = Event.select(
|
||||
Event.sub_label,
|
||||
).where(Event.sub_label != None)
|
||||
except:
|
||||
return jsonify(
|
||||
{"success": False, "message": "Failed to get sub_labels"}, "404"
|
||||
)
|
||||
|
||||
return jsonify(sub_labels)
|
||||
|
||||
|
||||
@bp.route("/<camera_name>/latest.jpg")
|
||||
def latest_frame(camera_name):
|
||||
draw_options = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user