tunedrop/backend/config.py
2025-08-03 01:31:38 +00:00

18 lines
559 B
Python

import os
from dotenv import load_dotenv
load_dotenv()
class Settings:
# If MUSIC_DIR is not absolute, make it relative to the project root
_music_dir = os.getenv("MUSIC_DIR", "music")
if not os.path.isabs(_music_dir):
# Use the directory where config.py is located as the base
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
MUSIC_DIR = os.path.abspath(os.path.join(BASE_DIR, _music_dir))
else:
MUSIC_DIR = _music_dir
NAVIDROME_SCAN_URL = os.getenv("NAVIDROME_SCAN_URL", "")
settings = Settings()