from pydantic import BaseModel, ConfigDict from pydantic.alias_generators import to_camel from datetime import datetime from typing import Any class ServerSettingsOut(BaseModel): model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True) id: str = "server-settings" token_secret: str = "" items_per_page: int = 10 metadata_provider: str = "google" store_covers_with_item: bool = False ratio_cover_book_name: bool = False cover_aspect_ratio: int = 1 disable_opds: bool = False log_level: int = 2 scanner_parse_same_author_name: bool = False auth_active_users: list = [] auth_local_users: list = [] class UserSettings(BaseModel): model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True) muted_badge_notifications: bool = False show_remaining_time: bool = False display_remaining_time: bool = False library_filters: dict = {} playback_rate: float = 1.0 bookmarks_list_collapsed: bool = False sleep_timer_duration: int = 900 sleep_timer_podcast_chapters: bool = False language: str = "de" class UserOut(BaseModel): model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True) id: str username: str email: str | None = None type: str = "user" is_active: bool = True is_locked: bool = False last_seen: datetime | None = None created_at: datetime token: str | None = None media_progress: list = [] bookmarks: list = [] is_admin: bool = False libraries_accessible: list[str] = [] item_tags_accessible: list[str] = [] permissions: dict = {} series_hide_from_continue_listening: list = [] settings: UserSettings = UserSettings() class UserCreate(BaseModel): username: str password: str email: str | None = None is_admin: bool = False class UserUpdate(BaseModel): email: str | None = None password: str | None = None is_admin: bool | None = None is_active: bool | None = None settings: dict | None = None