recursively scan the music directory to implicit depth 2
it is likely that the music library will contain directories of albums, read the files inside those dirs.
This commit is contained in:
parent
71a55ee143
commit
16f3592e97
|
|
@ -285,7 +285,9 @@
|
||||||
("listeners" . 0)
|
("listeners" . 0)
|
||||||
("stream-url" . "http://localhost:8000/asteroid"))))
|
("stream-url" . "http://localhost:8000/asteroid"))))
|
||||||
|
|
||||||
|
|
||||||
;; RADIANCE server management functions
|
;; RADIANCE server management functions
|
||||||
|
|
||||||
(defun start-server (&key (port *server-port*))
|
(defun start-server (&key (port *server-port*))
|
||||||
"Start the Asteroid Radio RADIANCE server"
|
"Start the Asteroid Radio RADIANCE server"
|
||||||
(format t "Starting Asteroid Radio RADIANCE server on port ~a~%" port)
|
(format t "Starting Asteroid Radio RADIANCE server on port ~a~%" port)
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,11 @@
|
||||||
(remove-if-not #'supported-audio-file-p
|
(remove-if-not #'supported-audio-file-p
|
||||||
(cl-fad:list-directory directory :follow-symlinks nil))))
|
(cl-fad:list-directory directory :follow-symlinks nil))))
|
||||||
|
|
||||||
|
(defun scan-directory-for-music-recursively (path)
|
||||||
|
(loop for directory in (uiop:subdirectories path)
|
||||||
|
with music = (scan-directory-for-music path)
|
||||||
|
appending (scan-directory-for-music directory)))
|
||||||
|
|
||||||
(defun extract-metadata-with-taglib (file-path)
|
(defun extract-metadata-with-taglib (file-path)
|
||||||
"Extract metadata using taglib library"
|
"Extract metadata using taglib library"
|
||||||
(handler-case
|
(handler-case
|
||||||
|
|
@ -68,7 +73,7 @@
|
||||||
(defun scan-music-library (&optional (directory *music-library-path*))
|
(defun scan-music-library (&optional (directory *music-library-path*))
|
||||||
"Scan music library directory and add tracks to database"
|
"Scan music library directory and add tracks to database"
|
||||||
(format t "Scanning music library: ~a~%" directory)
|
(format t "Scanning music library: ~a~%" directory)
|
||||||
(let ((audio-files (scan-directory-for-music directory))
|
(let ((audio-files (scan-directory-for-music-recursively directory))
|
||||||
(added-count 0))
|
(added-count 0))
|
||||||
(dolist (file audio-files)
|
(dolist (file audio-files)
|
||||||
(let ((metadata (extract-metadata-with-taglib file)))
|
(let ((metadata (extract-metadata-with-taglib file)))
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,9 @@
|
||||||
<div class="upload-info">
|
<div class="upload-info">
|
||||||
<p><strong>To add your own MP3 files:</strong></p>
|
<p><strong>To add your own MP3 files:</strong></p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Copy your MP3/FLAC/OGG/WAV files to: <code>/home/glenn/Projects/Code/asteroid/music/incoming/</code></li>
|
<li>Copy your MP3/FLAC/OGG/WAV files to: <code>/home/glenn/Projects/Code/asteroid/music/incoming/</code></li>
|
||||||
<li>Click "Copy Files to Library" below</li>
|
<li>Click "Copy Files to Library" below</li>
|
||||||
<li>Files will be moved to the library and added to the database</li>
|
<li>Files will be moved to the library and added to the database</li>
|
||||||
</ol>
|
</ol>
|
||||||
<p><em>Supported formats: MP3, FLAC, OGG, WAV</em></p>
|
<p><em>Supported formats: MP3, FLAC, OGG, WAV</em></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue