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):
|
||||
return None
|
||||
|
||||
def status(self):
|
||||
return {
|
||||
'volume': 0,
|
||||
'repeat': 0,
|
||||
'random': 0,
|
||||
'single': 0,
|
||||
'consume': 0,
|
||||
'playlist': 0,
|
||||
'playlistlength': 0,
|
||||
'xfade': 0,
|
||||
'state': 'stop',
|
||||
}
|
||||
def status_volume(self):
|
||||
return 0
|
||||
|
||||
def status_repeat(self):
|
||||
return 0
|
||||
|
||||
def status_random(self):
|
||||
return 0
|
||||
|
||||
def status_single(self):
|
||||
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$')
|
||||
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