Add status information to new Server panel (close #37)

This commit is contained in:
coderkun 2017-12-24 15:47:12 +01:00
commit fe1b60ea17
3 changed files with 184 additions and 4 deletions

View file

@ -375,10 +375,14 @@ class Client(Base):
if 'error' in status:
error = status['error']
# Album
file = None
album = None
pos = 0
song = self._parse_dict(self._call("currentsong"))
if song:
# File
if 'file' in song:
file = song['file']
# Track
track = self._extract_playlist_track(song)
if track:
@ -391,7 +395,15 @@ class Client(Base):
album = palbum
break
pos = pos - len(palbum.get_tracks())
self._callback(Client.SIGNAL_STATUS, state, album, pos, time, volume, error)
# Audio
audio = None
if 'audio' in status:
audio = status['audio']
# Bitrate
bitrate = None
if 'bitrate' in status:
bitrate = status['bitrate']
self._callback(Client.SIGNAL_STATUS, state, album, pos, time, volume, file, audio, bitrate, error)
def _load_albums(self):