diff options
author | Colin Okay <colin@cicadas.surf> | 2022-10-30 08:24:15 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-10-30 08:24:15 -0500 |
commit | 6ddf222b87c61f0977c6a0becf32c5cb883ed710 (patch) | |
tree | 1592879942a7bf86f38e1387e409484fdbc034fb /playlist.lisp | |
parent | e82f24fdb36a65e890264b67c196d0a55068b241 (diff) |
Tweak: dispaly tweak, truncating track titles to 30 chars
Diffstat (limited to 'playlist.lisp')
-rw-r--r-- | playlist.lisp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/playlist.lisp b/playlist.lisp index 0fe1ae9..27deada 100644 --- a/playlist.lisp +++ b/playlist.lisp @@ -119,10 +119,7 @@ (defun load-now-playing-display (ctl track-ctl) (let ((tr (track track-ctl))) - (setf (text (np-title ctl)) (track-title tr) - (text (np-artist ctl)) (if (track-artist tr) - (format nil "~a" (track-artist tr)) - "") + (setf (text (np-title ctl)) (track-listing-line tr nil) (url-src (np-thumb ctl)) (or (track-thumb-url tr) "") (text (np-dur ctl)) (secs-to-hms (or (track-duration tr) 0)) (text (np-time ctl)) (secs-to-hms 0)))) @@ -233,7 +230,6 @@ (img (:bind thumb)) (section (:h4) (span (:bind title)) - (span (:content " | ")) (span (:bind artist))) (p () (span (:bind time)) @@ -258,12 +254,17 @@ (pathname-name (track-file track)) (pathname-type (track-file track)))) -(defun track-listing-line (track) +(defun track-listing-line (track &optional (timep t)) (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))))) + (if timep + (format nil "~50<~a~;~a~;~a~>" + (subseq* title 0 30) + (if artist (concatenate 'string "by " + artist) "") + (secs-to-hms (or duration 0))) + (format nil "~45<~a~;~a~>" + (subseq* title 0 30) + (if artist (concatenate 'string "by " artist) ""))))) (defun create-track-list-item (list track ctl) (with-clog-create list |