Fix record motion config (#19672)

* fix record config

* Formatting
This commit is contained in:
Nicolas Mowen 2025-08-20 14:45:17 -06:00 committed by GitHub
parent 80144fe524
commit 6e3b40eaee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

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

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