42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
import os
|
|
from pydantic_settings import BaseSettings
|
|
|
|
class Settings(BaseSettings):
|
|
YANDEX_MUSIC_TOKEN: str = ""
|
|
MUSIC_DIR: str = "/music"
|
|
DATA_DIR: str = "/app/data"
|
|
NAVIDROME_URL: str = "https://music.qpid.pro"
|
|
NAVIDROME_USER: str = ""
|
|
NAVIDROME_PASSWORD: str = ""
|
|
DOWNLOAD_LYRICS: bool = True
|
|
AUDIO_FORMAT: str = "mp3"
|
|
AUDIO_BITRATE: str = "320k"
|
|
HOST: str = "0.0.0.0"
|
|
PORT: int = 8005
|
|
|
|
# Authentication & Security
|
|
AUTH_ENABLED: bool = True
|
|
SECRET_KEY: str = "navidrome-sync-secret-key-2026-qpid"
|
|
ADMIN_PASSWORD: str = ""
|
|
NAVIDROME_INTERNAL_URL: str = "http://127.0.0.1:4533"
|
|
|
|
# Ollama LLM Settings
|
|
OLLAMA_URL: str = "http://127.0.0.1:11434"
|
|
OLLAMA_MODEL: str = "qwen2.5:1.5b"
|
|
|
|
# Wave Rotation
|
|
WAVE_AUTO_ROTATE_HOURS: int = 6
|
|
WAVE_CANDIDATE_POOL: int = 40
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
extra = "ignore"
|
|
|
|
settings = Settings()
|
|
|
|
# Ensure directories exist
|
|
os.makedirs(settings.MUSIC_DIR, exist_ok=True)
|
|
os.makedirs(settings.DATA_DIR, exist_ok=True)
|
|
os.makedirs(os.path.join(settings.DATA_DIR, "tmp"), exist_ok=True)
|