users need always login

This commit is contained in:
2026-08-28 13:19:30 +02:00
parent cd16e3ae42
commit 1316e49456
9 changed files with 129 additions and 96 deletions
+10 -10
View File
@@ -1126,7 +1126,7 @@
(string-downcase app-id)))
(define store (open-playlist-store playlist-keystore))
(define stored-tabs
(load-user-playlists store "local" libraries))
(load-user-playlists store "anonymous" libraries))
(let* ((library (and (pair? libraries) (car libraries)))
(browser-entries
(if library
@@ -1142,7 +1142,7 @@
(selected-index 0)
(contexts (make-hash))
(initial-context (playlist-context tabs selected-index)))
(hash-set! contexts "local" initial-context)
(hash-set! contexts "anonymous" initial-context)
(define value
(player libraries
(remove-duplicates normalized-agent-ids string=?)
@@ -1175,7 +1175,7 @@
(make-hash)
store
contexts
"local"
"anonymous"
dlna-port))
value))
@@ -1185,7 +1185,7 @@
; post : Cached DLNA playback information has been incorporated.
; result : A JSON-compatible hash.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (player-state->jsexpr value #:username [username "local"])
(define (player-state->jsexpr value #:username [username "anonymous"])
(define normalized (normal-playlist-username username))
(call-with-semaphore
(player-command-lock value)
@@ -1264,7 +1264,7 @@
"playlist-clear" "tab-add" "tab-select" "tab-rename"
"tab-delete" "play"))
(define (player-command! value command data #:username [username "local"])
(define (player-command! value command data #:username [username "anonymous"])
(define normalized (normal-playlist-username username))
(call-with-semaphore
(player-command-lock value)
@@ -1488,7 +1488,7 @@
; post : Player state remains unchanged.
; result : Artwork bytes and MIME type, or #f when unavailable.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (player-track-artwork value artwork-id #:username [username "local"])
(define (player-track-artwork value artwork-id #:username [username "anonymous"])
(define item
(call-with-semaphore
(player-command-lock value)
@@ -1757,10 +1757,10 @@
"tab-rename"
(hasheq 'index 1 'name "Hans favorieten")
#:username "hans")
(define local-after-hans
(player-state->jsexpr example-player #:username "local"))
(check-equal? (length (hash-ref local-after-hans 'tabs)) 1)
(check-equal? (length (hash-ref local-after-hans 'tracks)) 2)
(define anonymous-after-hans
(player-state->jsexpr example-player #:username "anonymous"))
(check-equal? (length (hash-ref anonymous-after-hans 'tabs)) 1)
(check-equal? (length (hash-ref anonymous-after-hans 'tracks)) 2)
(player-close! example-player)
(define restored-player