Implemented play_or_stop in mpd

This commit is contained in:
Fabio Manganiello 2017-12-28 13:13:09 +01:00
parent c830988e09
commit 26c3afee68

View file

@ -36,6 +36,11 @@ class MusicMpdPlugin(MusicPlugin):
def stop(self): def stop(self):
return self._exec('stop') return self._exec('stop')
def play_or_stop(self):
status = self.status().output['state']
if status == 'play': return self._exec('stop')
else: return self._exec('play')
def next(self): def next(self):
return self._exec('next') return self._exec('next')