diff --git a/cl-streamer b/cl-streamer index c0f9c0e..d57a268 160000 --- a/cl-streamer +++ b/cl-streamer @@ -1 +1 @@ -Subproject commit c0f9c0e161e2076f7dde8fdcbcb0f701d02cc35b +Subproject commit d57a2683e757577a7292b63b5d3ad7016bb24187 diff --git a/stream-harmony.lisp b/stream-harmony.lisp index e92b677..b8b2fa6 100644 --- a/stream-harmony.lisp +++ b/stream-harmony.lisp @@ -307,7 +307,8 @@ (defun scan-music-library-files (&optional (directory *music-library-path*)) "Recursively scan DIRECTORY for supported audio files. - Returns a list of namestrings." + Returns a list of native namestrings (real OS paths without SBCL's + bracket escaping, safe to pass through parse-native-namestring later)." (let ((files nil) (extensions *supported-formats*)) (labels ((scan (dir) @@ -315,7 +316,7 @@ (dolist (entry (uiop:directory-files dir)) (let ((ext (pathname-type entry))) (when (and ext (member ext extensions :test #'string-equal)) - (push (namestring entry) files)))) + (push (sb-ext:native-namestring entry) files)))) (error (e) (log:debug "Error scanning ~A: ~A" dir e))) (handler-case @@ -323,7 +324,14 @@ (scan sub)) (error (e) (log:debug "Error listing subdirs of ~A: ~A" dir e))))) - (scan (pathname directory))) + ;; Use parse-native-namestring so directories with brackets (e.g. + ;; "[FLAC]") are not treated as wildcard patterns by SBCL. + (scan (sb-ext:parse-native-namestring + (etypecase directory + (string directory) + (pathname (sb-ext:native-namestring directory))) + nil *default-pathname-defaults* + :as-directory t))) (nreverse files))) (defvar *shuffle-library-cache* nil