Split statuses in to separate methods in the backend
This commit is contained in:
parent
df2381815c
commit
a00f9d9834
@ -9,15 +9,29 @@ class BaseBackend(object):
|
|||||||
def playlist_changes(self, version):
|
def playlist_changes(self, version):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def status(self):
|
def status_volume(self):
|
||||||
return {
|
return 0
|
||||||
'volume': 0,
|
|
||||||
'repeat': 0,
|
def status_repeat(self):
|
||||||
'random': 0,
|
return 0
|
||||||
'single': 0,
|
|
||||||
'consume': 0,
|
def status_random(self):
|
||||||
'playlist': 0,
|
return 0
|
||||||
'playlistlength': 0,
|
|
||||||
'xfade': 0,
|
def status_single(self):
|
||||||
'state': 'stop',
|
return 0
|
||||||
}
|
|
||||||
|
def status_consume(self):
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def status_playlist(self):
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def status_playlist_length(self):
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def status_xfade(self):
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def status_state(self):
|
||||||
|
return 'stop'
|
||||||
|
|||||||
@ -58,4 +58,14 @@ class MpdHandler(object):
|
|||||||
|
|
||||||
@register(r'^status$')
|
@register(r'^status$')
|
||||||
def _status(self):
|
def _status(self):
|
||||||
return self.backend.status()
|
return {
|
||||||
|
'volume': self.backend.status_volume(),
|
||||||
|
'repeat': self.backend.status_repeat(),
|
||||||
|
'random': self.backend.status_random(),
|
||||||
|
'single': self.backend.status_single(),
|
||||||
|
'consume': self.backend.status_consume(),
|
||||||
|
'playlist': self.backend.status_playlist(),
|
||||||
|
'playlistlength': self.backend.status_playlist_length(),
|
||||||
|
'xfade': self.backend.status_xfade(),
|
||||||
|
'state': self.backend.status_state(),
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user