import os from pathlib import Path # Local config. Paths can be overridden via environment variables. local_library_path = Path(os.environ.get("MUSIC_LIBRARY_PATH", "~/Music")).expanduser() work_dir = Path(os.environ.get("WORK_DIR", "./work_dir/new")) # Spotify app credentials. NEVER hardcode these here — set them in the # environment (see .env.example) so they don't end up in version control. # export SPOTIFY_CLIENT_ID=... # export SPOTIFY_CLIENT_SECRET=... client_id = os.environ.get("SPOTIFY_CLIENT_ID") client_secret = os.environ.get("SPOTIFY_CLIENT_SECRET") # Persistent store. Defaults to a local SQLite file; point DATABASE_URL at a # Postgres instance (postgresql+psycopg://user:pass@host/db) to switch with no # code changes. database_url = os.environ.get("DATABASE_URL", "sqlite:///./musicindexer.db") # Folder of prefetched JSON used to (re)build the DB without hitting the network. prefetched_dir = Path(os.environ.get("PREFETCHED_DIR", "./work_dir/latest-1")) # Contact email sent to MusicBrainz in the User-Agent (be a good API citizen). mb_contact = os.environ.get("MB_CONTACT", "music-indexer@example.com")