Use const for min config time

This commit is contained in:
Nick Mowen 2023-07-25 19:53:16 -06:00
parent 042f2e8b34
commit 5bb0ac9aca
2 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@ from frigate.const import (
AUDIO_MIN_CONFIDENCE,
CACHE_DIR,
DEFAULT_DB_PATH,
MAX_SEGMENT_CONFIG_DURATION,
MIN_SEGMENT_DURATION,
REGEX_CAMERA_NAME,
YAML_EXT,
@ -933,7 +934,7 @@ def verify_recording_segments_setup_with_reasonable_time(
)
config_duration = int(record_args[seg_arg_index + 1])
if config_duration < MIN_SEGMENT_DURATION or config_duration > 60:
if config_duration < MIN_SEGMENT_DURATION or config_duration > MAX_SEGMENT_CONFIG_DURATION:
raise ValueError(
f"Camera {camera_config.name} has invalid segment_time output arg, segment_time must be {MIN_SEGMENT_DURATION} <= x <= 60."
)

View File

@ -47,6 +47,7 @@ DRIVER_INTEL_iHD = "iHD"
MIN_SEGMENT_DURATION = 3
MAX_SEGMENT_DURATION = 600
MAX_SEGMENT_CONFIG_DURATION = 60
MAX_PLAYLIST_SECONDS = 7200 # support 2 hour segments for a single playlist to account for cameras with inconsistent segment times
# Internal Comms Topics