playlists and DLNA playback
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
racket/contract
|
||||
racket/list
|
||||
racket/mpair
|
||||
racket/runtime-path
|
||||
racket/string
|
||||
simple-ini
|
||||
simple-log
|
||||
@@ -20,6 +21,9 @@
|
||||
(or/c path-string?
|
||||
(list/c string? path-string?)))
|
||||
|
||||
(define-runtime-path default-playlist-keystore
|
||||
"data/playlists.keystore")
|
||||
|
||||
(define (ini-section-key-values config section-name)
|
||||
(let ((section (assoc section-name (mcdr config))))
|
||||
(if section
|
||||
@@ -62,6 +66,8 @@
|
||||
#:listen-ip [listen-ip "127.0.0.1"]
|
||||
#:port [port 8080]
|
||||
#:dlna-port [dlna-port 8734]
|
||||
#:playlist-keystore
|
||||
[playlist-keystore default-playlist-keystore]
|
||||
#:launch-browser? [launch-browser? #t])
|
||||
(->* ((listof library-spec/c))
|
||||
(#:allowed-agent-ids (listof string?)
|
||||
@@ -72,11 +78,13 @@
|
||||
#:listen-ip string?
|
||||
#:port exact-positive-integer?
|
||||
#:dlna-port exact-positive-integer?
|
||||
#:playlist-keystore (or/c path-string? #f)
|
||||
#:launch-browser? boolean?)
|
||||
any)
|
||||
(let* ((libraries (make-music-libraries music-paths))
|
||||
(player (make-player libraries
|
||||
#:allowed-agent-ids allowed-agent-ids
|
||||
#:playlist-keystore playlist-keystore
|
||||
#:dlna-port dlna-port))
|
||||
(auth-manager
|
||||
(make-auth-manager users
|
||||
@@ -107,6 +115,7 @@
|
||||
(define listen-ip #f)
|
||||
(define port #f)
|
||||
(define dlna-port #f)
|
||||
(define playlist-keystore #f)
|
||||
(define launch-browser? #t)
|
||||
(define config-file #f)
|
||||
|
||||
@@ -123,6 +132,9 @@
|
||||
[("--dlna-port") value
|
||||
"Port used to publish local audio to DLNA renderers"
|
||||
(set! dlna-port (string->number value))]
|
||||
[("--playlist-keystore") path
|
||||
"Keystore used to persist per-user playlist tabs"
|
||||
(set! playlist-keystore path)]
|
||||
[("--config") path
|
||||
"Read defaults from an INI file"
|
||||
(set! config-file path)]
|
||||
@@ -200,4 +212,12 @@
|
||||
(ini-get config 'server 'port 8080))
|
||||
#:dlna-port (or dlna-port
|
||||
(ini-get config 'player 'dlna-port 8734))
|
||||
#:playlist-keystore
|
||||
(or playlist-keystore
|
||||
(let ((configured
|
||||
(ini-get config 'player 'playlist-keystore #f)))
|
||||
(and (path-string? configured)
|
||||
(not (string=? (string-trim (format "~a" configured)) ""))
|
||||
configured))
|
||||
default-playlist-keystore)
|
||||
#:launch-browser? launch-browser?))
|
||||
|
||||
Reference in New Issue
Block a user