diff --git a/backend/.env b/backend/.env index 2a06665..66bffc1 100644 --- a/backend/.env +++ b/backend/.env @@ -1,2 +1,2 @@ -MUSIC_DIR=/root/tunedrop/backend/music +MUSIC_DIR=music/ NAVIDROME_SCAN_URL= \ No newline at end of file diff --git a/backend/__pycache__/config.cpython-310.pyc b/backend/__pycache__/config.cpython-310.pyc index 12898e5..9327efc 100644 Binary files a/backend/__pycache__/config.cpython-310.pyc and b/backend/__pycache__/config.cpython-310.pyc differ diff --git a/backend/config.py b/backend/config.py index 6e38ccd..19b09ad 100644 --- a/backend/config.py +++ b/backend/config.py @@ -4,7 +4,15 @@ from dotenv import load_dotenv load_dotenv() class Settings: - MUSIC_DIR = os.getenv("MUSIC_DIR", "/root/tunedrop/backend/music") + # 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() \ No newline at end of file