"""Application configuration using environment variables""" from pydantic_settings import BaseSettings from typing import List import os class Settings(BaseSettings): """Application settings loaded from environment variables""" # Application app_name: str = "Ohm Stream Downloader" app_version: str = "2.2" debug: bool = False # Server host: str = "0.0.0.0" port: int = 3000 reload: bool = True # Downloads download_dir: str = "downloads" max_parallel_downloads: int = 3 chunk_size: int = 1024 * 1024 # 1MB chunks # CORS cors_origins: List[str] = [ "http://localhost:3000", "http://127.0.0.1:3000", "http://192.168.1.204:3000", "http://192.168.1.204" ] # Storage favorites_storage_path: str = "favorites.json" # Sonarr sonarr_config_path: str = "config/sonarr.json" sonarr_mappings_path: str = "config/sonarr_mappings.json" # API Timeouts http_timeout: float = 10.0 download_timeout: int = 300 # 5 minutes # Logging log_level: str = "INFO" class Config: env_file = ".env" env_file_encoding = "utf-8" case_sensitive = False # Global settings instance settings = Settings() def get_settings() -> Settings: """Get the global settings instance""" return settings