Skip to content

NVR with realtime local object detection for IP cameras

Fix record motion config (#19672)

Nicolas Mowen6e3b40eaee29
diff --git a/frigate/record/cleanup.py b/frigate/record/cleanup.py
index 9d1e283060..b0359e71d7 100644
--- a/frigate/record/cleanup.py
+++ b/frigate/record/cleanup.py
@@ -308,7 +308,12 @@ class RecordingCleanup(threading.Thread):
now - datetime.timedelta(days=config.record.continuous.days)
).timestamp()
motion_expire_date = (
- now - datetime.timedelta(days=config.record.motion.days)
+ now
+ - datetime.timedelta(
+ days=max(
+ config.record.motion.days, config.record.continuous.days
+ ) # can't keep motion for less than continuous
+ )
).timestamp()
# Get all the reviews to check against
diff --git a/frigate/util/config.py b/frigate/util/config.py
index 5ae17d975a..56f5662fc2 100644
--- a/frigate/util/config.py
+++ b/frigate/util/config.py
@@ -363,6 +363,10 @@ def migrate_017_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]
if days:
if mode == "all":
continuous["days"] = days
+
+ # if a user was keeping all for number of days
+ # we need to keep motion and all for that number of days
+ motion["days"] = days
else:
motion["days"] = days