playlists and DLNA playback
This commit is contained in:
+20
-7
@@ -94,12 +94,21 @@
|
||||
#:headers
|
||||
(list (header #"Set-Cookie" (auth-expired-cookie)))))
|
||||
|
||||
(define (state-handler _request)
|
||||
(json-response (player-state->jsexpr current-player)))
|
||||
(define (request-username request)
|
||||
(or (auth-request-user current-auth request) "anonymous"))
|
||||
|
||||
(define (discover-handler _request)
|
||||
(define (state-handler request)
|
||||
(json-response
|
||||
(player-state->jsexpr
|
||||
current-player
|
||||
#:username (request-username request))))
|
||||
|
||||
(define (discover-handler request)
|
||||
(player-discover! current-player)
|
||||
(json-response (player-state->jsexpr current-player)))
|
||||
(json-response
|
||||
(player-state->jsexpr
|
||||
current-player
|
||||
#:username (request-username request))))
|
||||
|
||||
(define (command-handler request command)
|
||||
(with-handlers
|
||||
@@ -108,7 +117,8 @@
|
||||
(player-command!
|
||||
current-player
|
||||
command
|
||||
(request-jsexpr request)))))
|
||||
(request-jsexpr request)
|
||||
#:username (request-username request)))))
|
||||
|
||||
(define (agent-register-handler request)
|
||||
(with-handlers
|
||||
@@ -152,8 +162,11 @@
|
||||
(hasheq 'error "media token is invalid or expired")
|
||||
#:code 404))))
|
||||
|
||||
(define (artwork-handler _request artwork-id)
|
||||
(let ((value (player-track-artwork current-player artwork-id)))
|
||||
(define (artwork-handler request artwork-id)
|
||||
(let ((value (player-track-artwork
|
||||
current-player
|
||||
artwork-id
|
||||
#:username (request-username request))))
|
||||
(if value
|
||||
(response/output
|
||||
(λ (output)
|
||||
|
||||
Reference in New Issue
Block a user