mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 23:23:25 +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.
43 lines
968 B
Python
43 lines
968 B
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class ProwlarrConfig(BaseSettings):
|
|
enabled: bool = False
|
|
api_key: str = ""
|
|
url: str = "http://localhost:9696"
|
|
|
|
|
|
class JackettConfig(BaseSettings):
|
|
enabled: bool = False
|
|
api_key: str = ""
|
|
url: str = "http://localhost:9696"
|
|
indexers: list[str] = ["all"]
|
|
|
|
|
|
class ScoringRule(BaseSettings):
|
|
name: str
|
|
score_modifier: int = 0
|
|
negate: bool = False
|
|
|
|
|
|
class TitleScoringRule(ScoringRule):
|
|
keywords: list[str]
|
|
|
|
|
|
class IndexerFlagScoringRule(ScoringRule):
|
|
flags: list[str]
|
|
|
|
|
|
class ScoringRuleSet(BaseSettings):
|
|
name: str
|
|
libraries: list[str] = []
|
|
rule_names: list[str] = []
|
|
|
|
|
|
class IndexerConfig(BaseSettings):
|
|
prowlarr: ProwlarrConfig = ProwlarrConfig()
|
|
jackett: JackettConfig = JackettConfig()
|
|
title_scoring_rules: list[TitleScoringRule] = []
|
|
indexer_flag_scoring_rules: list[IndexerFlagScoringRule] = []
|
|
scoring_rule_sets: list[ScoringRuleSet] = []
|