mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-03 06:50:58 +00:00
Compare commits
3 Commits
baac31b556
...
545ad81059
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
545ad81059 | ||
|
|
181a8a8b24 | ||
|
|
c1420903d8 |
@ -33,7 +33,7 @@ class RetainModeEnum(str, Enum):
|
|||||||
|
|
||||||
|
|
||||||
class ReviewRetainConfig(FrigateBaseModel):
|
class ReviewRetainConfig(FrigateBaseModel):
|
||||||
days: float = Field(default=10, ge=10, title="Default retention period.")
|
days: float = Field(default=10, ge=0, title="Default retention period.")
|
||||||
mode: RetainModeEnum = Field(default=RetainModeEnum.motion, title="Retain mode.")
|
mode: RetainModeEnum = Field(default=RetainModeEnum.motion, title="Retain mode.")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -264,7 +264,9 @@ class RecordingCleanup(threading.Thread):
|
|||||||
logger.debug("Start deleted cameras.")
|
logger.debug("Start deleted cameras.")
|
||||||
|
|
||||||
# Handle deleted cameras
|
# Handle deleted cameras
|
||||||
expire_days = self.config.record.retain.days
|
expire_days = max(
|
||||||
|
self.config.record.continuous.days, self.config.record.motion.days
|
||||||
|
)
|
||||||
expire_before = (
|
expire_before = (
|
||||||
datetime.datetime.now() - datetime.timedelta(days=expire_days)
|
datetime.datetime.now() - datetime.timedelta(days=expire_days)
|
||||||
).timestamp()
|
).timestamp()
|
||||||
|
|||||||
@ -368,7 +368,8 @@ def migrate_017_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]
|
|||||||
|
|
||||||
new_config["record"]["continuous"] = continuous
|
new_config["record"]["continuous"] = continuous
|
||||||
new_config["record"]["motion"] = motion
|
new_config["record"]["motion"] = motion
|
||||||
del new_config["record"]["retain"]
|
|
||||||
|
del new_config["record"]["retain"]
|
||||||
|
|
||||||
for name, camera in config.get("cameras", {}).items():
|
for name, camera in config.get("cameras", {}).items():
|
||||||
camera_config: dict[str, dict[str, Any]] = camera.copy()
|
camera_config: dict[str, dict[str, Any]] = camera.copy()
|
||||||
@ -388,7 +389,8 @@ def migrate_017_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]
|
|||||||
|
|
||||||
camera_config["record"]["continuous"] = continuous
|
camera_config["record"]["continuous"] = continuous
|
||||||
camera_config["record"]["motion"] = motion
|
camera_config["record"]["motion"] = motion
|
||||||
del camera_config["record"]["retain"]
|
|
||||||
|
del camera_config["record"]["retain"]
|
||||||
|
|
||||||
new_config["cameras"][name] = camera_config
|
new_config["cameras"][name] = camera_config
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user