From 35a9d3407482fbf850d1fe36b12dac694884b6d6 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Sun, 30 Oct 2022 07:58:27 -0500 Subject: Tweak: display of tracks in list --- playlist.lisp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'playlist.lisp') 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 -- cgit v1.2.3