playlists and DLNA playback
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
(struct-out track)
|
||||
(struct-out artwork)
|
||||
make-music-libraries
|
||||
library-contains-audio-file?
|
||||
browse-library
|
||||
browser-entry->tracks
|
||||
track-artwork)
|
||||
@@ -133,6 +134,25 @@
|
||||
(browser-entry-relative-path entry))))))
|
||||
(browse-library library relative-path)))
|
||||
|
||||
(define (library-contains-audio-file? libraries file)
|
||||
(and (path-string? file)
|
||||
(file-exists? file)
|
||||
(audio-file? file)
|
||||
(let ((full-file
|
||||
(with-handlers ((exn:fail? (lambda (_) #f)))
|
||||
(simplify-path (path->complete-path file) #t))))
|
||||
(and full-file
|
||||
(for/or ((library (in-list libraries)))
|
||||
(define root
|
||||
(with-handlers ((exn:fail? (lambda (_) #f)))
|
||||
(simplify-path
|
||||
(path->complete-path (music-library-root library))
|
||||
#t)))
|
||||
(and root
|
||||
(let ((relative (find-relative-path root full-file)))
|
||||
(and (relative-path? relative)
|
||||
(not (member 'up (explode-path relative)))))))))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Provided functions
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
Reference in New Issue
Block a user