From 19f2c786e93686453c55837de38ae711de3f174d Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 30 Dec 2021 21:28:29 -0600 Subject: [PATCH] Untested attempt at adding to queue --- jukebox.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/jukebox.sh b/jukebox.sh index 87d8374..ef66ac9 100644 --- a/jukebox.sh +++ b/jukebox.sh @@ -31,5 +31,15 @@ while read -ep "Swipe: " INPUT; do continue fi - mpc stop -q && mpc clear -q && mpc add "$URI" && mpc play + # Add swipe to queue + mpc add "$URI" + + # How many things are in the queue? + COUNT=$( mpc playlist | wc -l ) + + # If there's only one thing in the queue, that means it was just added so start playing. + # Otherwise it will restart the currently playing track instead of continuing on with the playlist. + if [[ "$COUNT" -eq 1 ]] + mpc play + fi done