mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-04-14 01:17:50 +02:00
Ensure that go2rtc streams are cleaned (#15524)
* Ensure that go2rtc streams are cleaned * Formatting * Handle go2rtc config correctly * Set type
This commit is contained in:
parent
17f8939f97
commit
33ee32865f
@ -134,9 +134,25 @@ def config(request: Request):
|
|||||||
for zone_name, zone in config_obj.cameras[camera_name].zones.items():
|
for zone_name, zone in config_obj.cameras[camera_name].zones.items():
|
||||||
camera_dict["zones"][zone_name]["color"] = zone.color
|
camera_dict["zones"][zone_name]["color"] = zone.color
|
||||||
|
|
||||||
|
# remove go2rtc stream passwords
|
||||||
|
go2rtc: dict[str, any] = config_obj.go2rtc.model_dump(
|
||||||
|
mode="json", warnings="none", exclude_none=True
|
||||||
|
)
|
||||||
|
for stream_name, stream in go2rtc.get("streams", {}).items():
|
||||||
|
if isinstance(stream, str):
|
||||||
|
cleaned = clean_camera_user_pass(stream)
|
||||||
|
else:
|
||||||
|
cleaned = []
|
||||||
|
|
||||||
|
for item in stream:
|
||||||
|
cleaned.append(clean_camera_user_pass(item))
|
||||||
|
|
||||||
|
config["go2rtc"]["streams"][stream_name] = cleaned
|
||||||
|
|
||||||
config["plus"] = {"enabled": request.app.frigate_config.plus_api.is_active()}
|
config["plus"] = {"enabled": request.app.frigate_config.plus_api.is_active()}
|
||||||
config["model"]["colormap"] = config_obj.model.colormap
|
config["model"]["colormap"] = config_obj.model.colormap
|
||||||
|
|
||||||
|
# use merged labelamp
|
||||||
for detector_config in config["detectors"].values():
|
for detector_config in config["detectors"].values():
|
||||||
detector_config["model"]["labelmap"] = (
|
detector_config["model"]["labelmap"] = (
|
||||||
request.app.frigate_config.model.merged_labelmap
|
request.app.frigate_config.model.merged_labelmap
|
||||||
|
Loading…
Reference in New Issue
Block a user