From f26dec3a9afb6ae403f6f16286860c446b891c56 Mon Sep 17 00:00:00 2001 From: lenlennart <53861396+lenlennart@users.noreply.github.com> Date: Wed, 22 Sep 2021 12:26:24 +0200 Subject: [PATCH] adjust playerpauseforce adjust playerpauseforce to only pauses when currently playing see bug #1520 --- scripts/playout_controls.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/playout_controls.sh b/scripts/playout_controls.sh index e67989329..0bc6a3a67 100755 --- a/scripts/playout_controls.sh +++ b/scripts/playout_controls.sh @@ -744,7 +744,13 @@ case $COMMAND in then /bin/sleep $VALUE fi - mpc pause + PLAYSTATE=$(echo -e "status\nclose" | nc -w 1 localhost 6600 | grep -o -P '(?<=state: ).*') + # Only pause when currently playing + # Otherwise mpc might go from "stopped" back to "pause", causing inconsitency as there is nothing to "resume" + if [ "$PLAYSTATE" == "play" ] + then + mpc pause + fi ;; playerplay) # play / resume current track