From cf746b38963c1c5bba9a87acd9e8d012fc0a9189 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 15 May 2022 20:30:28 +0100 Subject: whitespace and nits --- lib/media/jao-mpris.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lib/media/jao-mpris.el') diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el index 2537fa8..47a35a7 100644 --- a/lib/media/jao-mpris.el +++ b/lib/media/jao-mpris.el @@ -93,7 +93,8 @@ ;;;###autoload (defun jao-mpris-reset () (interactive) - (setq jao-mpris-track-string "")) + (setq jao-mpris-track-string "" + jao-mpris--current nil)) (defun jao-mpris--get (k &optional l) (when-let (v (alist-get k (or l jao-mpris--current))) @@ -154,20 +155,22 @@ (jao-minibuffer-add-msg-variable 'jao-mpris-track-string (- order)) (jao-minibuffer-add-variable 'jao-mpris-track-string order))) -(defun jao-mpris--handler (_iname properties &rest _args) +(defun jao-mpris--handler (iname properties &rest _args) (let ((inhibit-message t)) - (message "Received properties: %S from %s" properties _iname)) + (message "Received properties: %S from %s" properties iname)) (when-let (md (caadr (assoc "Metadata" properties))) (let ((tno (caadr (assoc "xesam:trackNumber" md))) (tlt (caadr (assoc "xesam:title" 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) - (jao-mpris--set-current 'title tlt) - (jao-mpris--set-current 'artist art) - (jao-mpris--set-current 'album alb) - (jao-mpris--set-current 'length len))) + (if (string= (or tlt "") "TIDAL") + (jao-mpris-reset) + (jao-mpris--set-current 'track tno) + (jao-mpris--set-current 'title tlt) + (jao-mpris--set-current 'artist art) + (jao-mpris--set-current 'album alb) + (jao-mpris--set-current 'length len)))) (when-let (st (caadr (assoc "PlaybackStatus" properties))) (jao-mpris--set-current 'status st) (when (string= st "Stopped") -- cgit v1.2.3