summaryrefslogtreecommitdiff
path: root/playlist.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-10-26 16:37:26 -0500
committerColin Okay <colin@cicadas.surf>2022-10-26 16:37:26 -0500
commitacebbb24c9ae406e41fb3798ccb31a95d73d2207 (patch)
treebba37f9db7a7a7f6ccc5961b8aad5a711cc95d83 /playlist.lisp
parente774af20dd3fb625f4477807cc011fac11c13f32 (diff)
Add: intialize now playing display
Diffstat (limited to 'playlist.lisp')
-rw-r--r--playlist.lisp9
1 files changed, 8 insertions, 1 deletions
diff --git a/playlist.lisp b/playlist.lisp
index b28f82e..82f6f49 100644
--- a/playlist.lisp
+++ b/playlist.lisp
@@ -144,6 +144,12 @@
;;; CLIENT CONTROL
+(defun initialize-now-playing (elem)
+ (when-let (ctl (get-playlist-ctl elem))
+ (when (tracks ctl)
+ (setf (now-playing-track ctl) (first (tracks ctl)))
+ (load-now-playing-display ctl (now-playing-track ctl)))))
+
(defun load-now-playing-display (ctl track-ctl)
(let ((tr (track track-ctl)))
(setf (text (np-title ctl)) (track-title tr)
@@ -370,4 +376,5 @@
(now-playing-display (ctl))
(track-listing (pl))
(new-track-form (pl)))
- (setf (pl-title ctl) title-elem)))))
+ (setf (pl-title ctl) title-elem)
+ (initialize-now-playing body)))))