From f44ed3c3ecee463e7d9ee742aaee6950e9f6cfff Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 31 May 2021 21:00:09 +0100 Subject: mpc: automatic next random album --- init.org | 4 +++- lib/media/jao-mpc.el | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/init.org b/init.org index df1aa7c..6909018 100644 --- a/init.org +++ b/init.org @@ -3063,7 +3063,9 @@ ("V" (jao-mixer-get-level "Capture") "show")) "Utilities" (("c" jao-player-connect "reconnect to mpd") - ("N" jao-random-album-next "random album") + ("N" jao-random-album-next "next random album") + ("r" jao-random-album-toggle "toggle random album" + :toggle jao-random-album-p) ("s-m" jao-hydra-media/body nil)))) #+end_src diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el index 6531a8d..89509ec 100644 --- a/lib/media/jao-mpc.el +++ b/lib/media/jao-mpc.el @@ -112,7 +112,9 @@ (when ok (setq jao-mpc--current (jao-mpc--parse-retort txt)) (jao-mpc--update-minibuffer) - (when next (funcall next)))))) + (cond (next (funcall next)) + ((and (null jao-mpc--current) jao-random-album-p) + (jao-random-album-next))))))) (jao-mpc--send "currentsong" cb))) (defun jao-mpc--watcher (_conn _subsys) -- cgit v1.2.3