fix record config

This commit is contained in:
Nicolas Mowen 2025-08-20 14:28:03 -06:00
parent 80144fe524
commit 598bdaa8f8
2 changed files with 8 additions and 1 deletions

View File

@ -308,7 +308,10 @@ 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

View File

@ -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