summaryrefslogtreecommitdiffhomepage
path: root/lib/media
diff options
context:
space:
mode:
Diffstat (limited to 'lib/media')
-rw-r--r--lib/media/jao-mpc.el6
-rw-r--r--lib/media/jao-mpris.el9
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el
index 0f000da..52fdfbf 100644
--- a/lib/media/jao-mpc.el
+++ b/lib/media/jao-mpc.el
@@ -125,7 +125,7 @@
(defvar jao-mpc--idle-procs nil)
(defun jao-mpc--idle-loop (&optional port)
- (when-let (proc (alist-get port jao-mpc--idle-procs))
+ (when-let* ((proc (alist-get port jao-mpc--idle-procs)))
(ignore-errors (kill-process proc)))
(setf (alist-get port jao-mpc--idle-procs nil t)
(make-process :name (format "jao-mpc-idleloop (%s)" port)
@@ -146,7 +146,7 @@
(read-only-mode 1))
(defun jao-mpc--album-buffer ()
- (if-let (b (get-buffer jao-mpc--albums))
+ (if-let* ((b (get-buffer jao-mpc--albums)))
b
(with-current-buffer (get-buffer-create jao-mpc--albums)
(jao-mpc-albums-mode)
@@ -332,7 +332,7 @@
(jao-mpc--cmd jao-mpc--simple-albums-cmd port)
albums-str))
(albums (split-string albums-str "\n" t)))
- (when-let (album (completing-read "Play album: " albums nil t))
+ (when-let* ((album (completing-read "Play album: " albums nil t)))
(jao-mpc--add-and-play (car (split-string album "-" t " ")) port))))
(provide 'jao-mpc)
diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el
index 3bb2636..f2974ab 100644
--- a/lib/media/jao-mpris.el
+++ b/lib/media/jao-mpris.el
@@ -97,7 +97,7 @@
jao-mpris--current nil))
(defun jao-mpris--get (k &optional l)
- (when-let (v (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)
@@ -146,7 +146,7 @@
(interactive "P")
(when refresh (jao-mpris--track))
(when jao-mpris--current
- (jao-notify (format "%s%s" (if-let (s (jao-mpris--get 'status))
+ (jao-notify (format "%s%s" (if-let* ((s (jao-mpris--get 'status)))
(format "%s: " s)
"")
(jao-mpris--format)))))
@@ -159,7 +159,7 @@
(defun jao-mpris--handler (iname properties &rest _args)
(let ((inhibit-message t))
(message "Received properties: %S from %s" properties iname))
- (when-let (md (caadr (assoc "Metadata" properties)))
+ (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)))
@@ -172,7 +172,8 @@
(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)))
+ (when-let* ((st (or (caadr (assoc "PlaybackStatus" properties))
+ (jao-mpris--get 'status))))
(jao-mpris--set-current 'status st)
(when (string= st "Stopped")
(dolist (k '(track title artist album length))