Skip to content

Commit

Permalink
Merge pull request #1521 from lenlennart/patch-1
Browse files Browse the repository at this point in the history
adjust playerpauseforce
  • Loading branch information
MiczFlor authored Feb 27, 2022
2 parents 7b5b956 + f26dec3 commit 3820d69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/playout_controls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3820d69

Please sign in to comment.