From 0d63838f02043495bd6b11bdf98bbe12d28058f1 Mon Sep 17 00:00:00 2001 From: you Date: Sat, 29 Jun 2024 18:54:27 +0200 Subject: [PATCH] Uses the same loading method for the go2rtc configuration as for the main configuration --- .../main/rootfs/usr/local/go2rtc/create_config.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docker/main/rootfs/usr/local/go2rtc/create_config.py b/docker/main/rootfs/usr/local/go2rtc/create_config.py index 44d2170ee..d011949fd 100644 --- a/docker/main/rootfs/usr/local/go2rtc/create_config.py +++ b/docker/main/rootfs/usr/local/go2rtc/create_config.py @@ -8,11 +8,16 @@ from pathlib import Path import yaml sys.path.insert(0, "/opt/frigate") -from frigate.const import BIRDSEYE_PIPE # noqa: E402 +from frigate.const import ( # noqa: E402 + BIRDSEYE_PIPE, + YAML_EXT, +) from frigate.ffmpeg_presets import ( # noqa: E402 parse_preset_hardware_acceleration_encode, ) - +from frigate.util.builtin import ( + load_config_with_no_duplicates, +) sys.path.remove("/opt/frigate") @@ -36,8 +41,8 @@ try: with open(config_file) as f: raw_config = f.read() - if config_file.endswith((".yaml", ".yml")): - config: dict[str, any] = yaml.safe_load(raw_config) + if config_file.endswith(YAML_EXT): + config: dict[str, any] = load_config_with_no_duplicates(raw_config) elif config_file.endswith(".json"): config: dict[str, any] = json.loads(raw_config) except FileNotFoundError: