mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-24 15:35:46 +03:00
This reverts commit d24b96d3bb.
This commit is contained in:
+1
-51
@@ -13,7 +13,7 @@ from frigate.util.services import get_video_properties
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
CURRENT_CONFIG_VERSION = "0.18-0"
|
||||
CURRENT_CONFIG_VERSION = "0.17-0"
|
||||
DEFAULT_CONFIG_FILE = os.path.join(CONFIG_DIR, "config.yml")
|
||||
|
||||
|
||||
@@ -98,13 +98,6 @@ def migrate_frigate_config(config_file: str):
|
||||
yaml.dump(new_config, f)
|
||||
previous_version = "0.17-0"
|
||||
|
||||
if previous_version < "0.18-0":
|
||||
logger.info(f"Migrating frigate config from {previous_version} to 0.18-0...")
|
||||
new_config = migrate_018_0(config)
|
||||
with open(config_file, "w") as f:
|
||||
yaml.dump(new_config, f)
|
||||
previous_version = "0.18-0"
|
||||
|
||||
logger.info("Finished frigate config migration...")
|
||||
|
||||
|
||||
@@ -434,49 +427,6 @@ def migrate_017_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]
|
||||
return new_config
|
||||
|
||||
|
||||
def migrate_018_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]]:
|
||||
"""Handle migrating frigate config to 0.18-0"""
|
||||
new_config = config.copy()
|
||||
|
||||
# Remove deprecated sync_recordings from global record config
|
||||
if new_config.get("record", {}).get("sync_recordings") is not None:
|
||||
del new_config["record"]["sync_recordings"]
|
||||
|
||||
# Remove deprecated timelapse_args from global record export config
|
||||
if new_config.get("record", {}).get("export", {}).get("timelapse_args") is not None:
|
||||
del new_config["record"]["export"]["timelapse_args"]
|
||||
# Remove export section if empty
|
||||
if not new_config.get("record", {}).get("export"):
|
||||
del new_config["record"]["export"]
|
||||
# Remove record section if empty
|
||||
if not new_config.get("record"):
|
||||
del new_config["record"]
|
||||
|
||||
# Remove deprecated sync_recordings and timelapse_args from camera-specific record configs
|
||||
for name, camera in config.get("cameras", {}).items():
|
||||
camera_config: dict[str, dict[str, Any]] = camera.copy()
|
||||
|
||||
if camera_config.get("record", {}).get("sync_recordings") is not None:
|
||||
del camera_config["record"]["sync_recordings"]
|
||||
|
||||
if (
|
||||
camera_config.get("record", {}).get("export", {}).get("timelapse_args")
|
||||
is not None
|
||||
):
|
||||
del camera_config["record"]["export"]["timelapse_args"]
|
||||
# Remove export section if empty
|
||||
if not camera_config.get("record", {}).get("export"):
|
||||
del camera_config["record"]["export"]
|
||||
# Remove record section if empty
|
||||
if not camera_config.get("record"):
|
||||
del camera_config["record"]
|
||||
|
||||
new_config["cameras"][name] = camera_config
|
||||
|
||||
new_config["version"] = "0.18-0"
|
||||
return new_config
|
||||
|
||||
|
||||
def get_relative_coordinates(
|
||||
mask: Optional[Union[str, list]], frame_shape: tuple[int, int]
|
||||
) -> Union[str, list]:
|
||||
|
||||
Reference in New Issue
Block a user