Fix scan-library path to work in both development and production

- Auto-detect music library path based on environment
- Check for music/library/ directory for local development
- Default to /app/music/ for production Docker deployment
- Allow MUSIC_LIBRARY_PATH environment variable override
- Fixes scan-library function failing on production server
This commit is contained in:
Glenn Thompson 2025-11-17 13:21:01 +03:00
parent dddc27e19e
commit 0b72781052
1 changed files with 4 additions and 1 deletions

View File

@ -17,7 +17,10 @@
(defparameter *server-port* 8080)
(defparameter *music-library-path*
(or (uiop:getenv "MUSIC_LIBRARY_PATH")
"/app/music/"))
;; Default to /app/music/ for production Docker, but check if music/library/ exists for local dev
(if (probe-file (merge-pathnames "music/library/" (asdf:system-source-directory :asteroid)))
(merge-pathnames "music/library/" (asdf:system-source-directory :asteroid))
"/app/music/")))
(defparameter *supported-formats* '("mp3" "flac" "ogg" "wav"))
(defparameter *stream-base-url* "http://localhost:8000")