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
1 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,11 @@ class MusicMpdPlugin(MusicPlugin):
def stop(self):
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):
return self._exec('next')