playlists and DLNA playback

This commit is contained in:
2026-08-28 12:51:12 +02:00
parent 69433abee1
commit cd16e3ae42
12 changed files with 1028 additions and 415 deletions
+20 -7
View File
@@ -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)