aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-10-30 07:58:27 -0500
committerColin Okay <colin@cicadas.surf>2022-10-30 07:58:27 -0500
commit35a9d3407482fbf850d1fe36b12dac694884b6d6 (patch)
tree103228e0b5ca17cf5b56eba61cd43b6b280d3c70
parente7dfe39add9ba4987a08d10aa29da44cdeaea8b7 (diff)
Tweak: display of tracks in list
-rw-r--r--playlist.lisp15
1 files changed, 6 insertions, 9 deletions
diff --git a/playlist.lisp b/playlist.lisp
index c8c3bc7..0fe1ae9 100644
--- a/playlist.lisp
+++ b/playlist.lisp
@@ -259,12 +259,11 @@
(pathname-type (track-file track))))
(defun track-listing-line (track)
- (with-slots (artist title) track
- (with-output-to-string (out)
- (when artist
- (princ artist out)
- (princ " - " out))
- (princ title out))))
+ (with-slots (artist title duration) track
+ (format nil "~50<~a~;~a~;~a~>"
+ title
+ (if artist (concatenate 'string "by " artist) "")
+ (secs-to-hms (or duration 0)))))
(defun create-track-list-item (list track ctl)
(with-clog-create list
@@ -274,9 +273,7 @@
(button (:content "↓" :bind downbtn))
(button (:content "↑" :bind upbtn)))
(div (:bind item :class "track-list-item")
- (span (:content (track-listing-line track)))
- (span (:content " -- "))
- (span (:content (secs-to-hms (or (track-duration track) 0)))))
+ (section (:pre :content (track-listing-line track))))
(audio (:source (media-url-path track) :controls nil :bind audio)))
(let ((track-ctl
(make-instance 'track-ctl