summaryrefslogtreecommitdiffhomepage
path: root/lib/media
diff options
context:
space:
mode:
Diffstat (limited to 'lib/media')
-rw-r--r--lib/media/jao-mpris.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el
index 4df83c7..63a5aae 100644
--- a/lib/media/jao-mpris.el
+++ b/lib/media/jao-mpris.el
@@ -91,7 +91,8 @@
(defvar jao-mpris-track-string "")
(defun jao-mpris--get (k &optional l)
- (alist-get k (or l jao-mpris--current)))
+ (when-let (v (alist-get k (or l jao-mpris--current)))
+ (if (consp v) (car v) v)))
(defun jao-mpris--set-current (k v)
(when v (setf (alist-get k jao-mpris--current "" t) v)))
@@ -116,9 +117,10 @@
(jao--put-face (format "%s" (or track "")) 'jao-themes-f00)
(jao--put-face (or title "") 'jao-themes-f01)
(jao--put-face (or artist "") 'jao-themes-f11)
- (jao--put-face (if album (format " (%s)" album) "")
+ (jao--put-face (if (and album (not (string-blank-p album)))
+ (format " (%s)" album) "")
'jao-themes-f01)
- (if duration (format " %s" duration) ""))))
+ (if duration (format " - %s" duration) ""))))
(defun jao-mpris--track (&optional info)
(let ((info (or info (jao-playerctl--status))))
@@ -153,7 +155,7 @@
(when-let (md (caadr (assoc "Metadata" properties)))
(let ((tno (caadr (assoc "xesam:trackNumber" md)))
(tlt (caadr (assoc "xesam:title" md)))
- (art (caaadr (assoc "xesam:artist" md)))
+ (art (caadr (assoc "xesam:artist" md)))
(alb (caadr (assoc "xesam:album" md)))
(len (caadr (assoc "mpris:length" md))))
(jao-mpris--set-current 'track tno)