From 79e4f603ae99eaf38df8eb1d1c420f86da39d36d Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 6 Aug 2014 16:04:03 -0500 Subject: [PATCH] Fix play/pause when stopped Sending the 'pause' command has no effect if the player is currently stopped. Thus, 'play' must be sent explicitly in that case. --- src/mpdnotify.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mpdnotify.py b/src/mpdnotify.py index 2a46084..2d1dc1a 100644 --- a/src/mpdnotify.py +++ b/src/mpdnotify.py @@ -147,8 +147,10 @@ class Notifier(object): def bind_keys(self): def playpause(): status = self.client.status() - pause = int(status['state'] == 'play') - self.client.pause(pause) + if status['state'] == 'stop': + self.client.play() + else: + self.client.pause() def volume_down(): status = self.client.status()