corrected getting position of current playing track

This commit is contained in:
coderkun 2013-03-02 16:13:58 +01:00
commit d6993bfe5b

7
mcg.py
View file

@ -272,7 +272,12 @@ class MCGClient(MCGBase, mpd.MPDClient):
hash = MCGAlbum.hash(song['album'], song['date']) hash = MCGAlbum.hash(song['album'], song['date'])
if hash in self._albums: if hash in self._albums:
album = self._albums[hash] album = self._albums[hash]
pos = int(song['pos']) pos = song['track']
if type(pos) is list:
pos = pos[0]
if '/' in pos:
pos = pos[0: pos.index('/')]
pos = int(pos) - 1
self._state = state self._state = state
self._callback(MCGClient.SIGNAL_STATUS, state, album, pos, volume, error) self._callback(MCGClient.SIGNAL_STATUS, state, album, pos, volume, error)