From 2a505e482ddea22befb528a79baf5f5a50833cea Mon Sep 17 00:00:00 2001 From: Glenn Thompson Date: Mon, 17 Nov 2025 13:21:01 +0300 Subject: [PATCH] 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 --- asteroid.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/asteroid.lisp b/asteroid.lisp index b6655d6..6708dc8 100644 --- a/asteroid.lisp +++ b/asteroid.lisp @@ -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")