Added play_if_paused_or_stopped method to mpd plugin

This commit is contained in:
Fabio Manganiello 2018-09-25 19:40:00 +02:00
parent 13c1895295
commit b88f7fcecc
1 changed files with 8 additions and 0 deletions

View File

@ -87,6 +87,14 @@ class MusicMpdPlugin(MusicPlugin):
if status == 'pause':
return self._exec('play')
@action
def play_if_paused_or_stopped(self):
""" Play only if it's paused or stopped """
status = self.status().output['state']
if status == 'pause' or status == 'stop':
return self._exec('play')
@action
def stop(self):
""" Stop playback """