From 62657ad05ad3cc4035be49e926b3979703bc8b3e Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 11 Sep 2024 14:46:24 -0600 Subject: [PATCH] Ensure detections are not immediately deleted (#13683) * Ensure detections are not immediately deleted * Formatting --- frigate/util/config.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frigate/util/config.py b/frigate/util/config.py index b7fbb7a61..a40efeafd 100644 --- a/frigate/util/config.py +++ b/frigate/util/config.py @@ -192,7 +192,10 @@ def migrate_015_0(config: dict[str, dict[str, any]]) -> dict[str, dict[str, any] "default" ] else: - detections_retention["retain"]["days"] = 0 + continuous_days = config.get("record", {}).get("retain", {}).get("days") + detections_retention["retain"]["days"] = ( + continuous_days if continuous_days else 1 + ) new_config["record"]["alerts"] = alerts_retention new_config["record"]["detections"] = detections_retention @@ -232,7 +235,12 @@ def migrate_015_0(config: dict[str, dict[str, any]]) -> dict[str, dict[str, any] "default" ] else: - detections_retention["retain"]["days"] = 0 + continuous_days = ( + camera_config.get("record", {}).get("retain", {}).get("days") + ) + detections_retention["retain"]["days"] = ( + continuous_days if continuous_days else 1 + ) camera_config["record"]["alerts"] = alerts_retention camera_config["record"]["detections"] = detections_retention