From 969694fed691e2149b512039560b8974f6778639 Mon Sep 17 00:00:00 2001 From: Dominic Windisch Date: Fri, 16 Feb 2024 16:02:43 +0100 Subject: [PATCH] Update uisettings.py --- photobooth/services/config/groups/uisettings.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/photobooth/services/config/groups/uisettings.py b/photobooth/services/config/groups/uisettings.py index 0e627d4d..d6bd9215 100644 --- a/photobooth/services/config/groups/uisettings.py +++ b/photobooth/services/config/groups/uisettings.py @@ -9,7 +9,7 @@ from pathlib import Path from typing import Any -from pydantic import Field +from pydantic import Field, validator from pydantic.fields import FieldInfo from pydantic_settings import BaseSettings, PydanticBaseSettingsSource, SettingsConfigDict @@ -99,6 +99,18 @@ class GroupUiSettings(BaseSettings): description="Show button to admin center, usually only during setup.", ) + show_automatic_slideshow_timeout: int = Field( + default=300, description="Timeout (seconds) after which a random order slideshow of all images is started. Set to 0 to disable." + ) + + @validator("show_automatic_slideshow_timeout") + def allow_zero_or_large(cls, v): + if v < 0: + raise ValueError("ensure this value is not negative") + if v > 0 and v < 30: + raise ValueError("ensure this value is at least 30") + return v + livestream_mirror_effect: bool = Field( default=True, description="Flip livestream horizontally to create a mirror effect feeling more natural to users.",