mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-23 17:28:42 +02:00
- Add default instances to all nested config classes (TorrentConfig, NotificationConfig, IndexerConfig, MetadataProviderConfig, AuthConfig) - Add default values to AllEncompassingConfig fields to prevent validation errors during testing - Update GitHub workflow to copy config.example.toml before running tests - Ensures tests can run without requiring complete configuration files while maintaining production functionality Fixes test collection errors where pydantic validation failed due to missing required config sections.
36 lines
990 B
Python
36 lines
990 B
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class QbittorrentConfig(BaseSettings):
|
|
model_config = SettingsConfigDict(env_prefix="QBITTORRENT_")
|
|
host: str = "localhost"
|
|
port: int = 8080
|
|
username: str = "admin"
|
|
password: str = "admin"
|
|
enabled: bool = False
|
|
|
|
|
|
class TransmissionConfig(BaseSettings):
|
|
model_config = SettingsConfigDict(env_prefix="TRANSMISSION_")
|
|
path: str = "/transmission/rpc"
|
|
https_enabled: bool = True
|
|
host: str = "localhost"
|
|
port: int = 9091
|
|
username: str = ""
|
|
password: str = ""
|
|
enabled: bool = False
|
|
|
|
|
|
class SabnzbdConfig(BaseSettings):
|
|
model_config = SettingsConfigDict(env_prefix="SABNZBD_")
|
|
host: str = "localhost"
|
|
port: int = 8080
|
|
api_key: str = ""
|
|
enabled: bool = False
|
|
|
|
|
|
class TorrentConfig(BaseSettings):
|
|
qbittorrent: QbittorrentConfig = QbittorrentConfig()
|
|
transmission: TransmissionConfig = TransmissionConfig()
|
|
sabnzbd: SabnzbdConfig = SabnzbdConfig()
|