mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-07 00:06:57 +01:00
improve warning for retain modes
This commit is contained in:
parent
329e5f8f91
commit
de58bdcc9f
@ -836,14 +836,18 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
camera_config.record.retain.days = camera_config.record.retain_days
|
camera_config.record.retain.days = camera_config.record.retain_days
|
||||||
|
|
||||||
# warning if the higher level record mode is potentially more restrictive than the events
|
# warning if the higher level record mode is potentially more restrictive than the events
|
||||||
|
rank_map = {
|
||||||
|
RetainModeEnum.all: 0,
|
||||||
|
RetainModeEnum.motion: 1,
|
||||||
|
RetainModeEnum.active_objects: 2,
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
camera_config.record.retain.days != 0
|
camera_config.record.retain.days != 0
|
||||||
and camera_config.record.retain.mode != RetainModeEnum.all
|
and rank_map[camera_config.record.retain.mode]
|
||||||
and camera_config.record.events.retain.mode
|
> rank_map[camera_config.record.events.retain.mode]
|
||||||
!= camera_config.record.retain.mode
|
|
||||||
):
|
):
|
||||||
logger.warning(
|
logger.warning(
|
||||||
f"Recording retention is configured for {camera_config.record.retain.mode} and event retention is configured for {camera_config.record.events.retain.mode}. The more restrictive retention policy will be applied."
|
f"{name}: Recording retention is configured for {camera_config.record.retain.mode} and event retention is configured for {camera_config.record.events.retain.mode}. The more restrictive retention policy will be applied."
|
||||||
)
|
)
|
||||||
# generage the ffmpeg commands
|
# generage the ffmpeg commands
|
||||||
camera_config.create_ffmpeg_cmds()
|
camera_config.create_ffmpeg_cmds()
|
||||||
|
Loading…
Reference in New Issue
Block a user