From d6993bfe5b4e786870e863b7d979ec251129c16b Mon Sep 17 00:00:00 2001 From: coderkun Date: Sat, 2 Mar 2013 16:13:58 +0100 Subject: [PATCH] corrected getting position of current playing track --- mcg.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mcg.py b/mcg.py index 9958f7e..d1f9989 100644 --- a/mcg.py +++ b/mcg.py @@ -272,7 +272,12 @@ class MCGClient(MCGBase, mpd.MPDClient): hash = MCGAlbum.hash(song['album'], song['date']) if hash in self._albums: 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._callback(MCGClient.SIGNAL_STATUS, state, album, pos, volume, error)