summaryrefslogtreecommitdiff
path: root/playlist.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'playlist.lisp')
-rw-r--r--playlist.lisp21
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