fix changing of song by storing playlist position for each track (fixes #1)

This commit is contained in:
coderkun 2016-04-16 19:14:34 +02:00
commit da06f1fff5
2 changed files with 16 additions and 4 deletions

View file

@ -423,7 +423,7 @@ class Client(Base):
song['time'] = 0
if 'date' not in song:
song['date'] = None
track = MCGTrack(song['artist'], song['title'], song['track'], song['time'], song['date'], song['file'])
track = MCGPlaylistTrack(song['artist'], song['title'], song['track'], song['time'], song['date'], song['file'], song['pos'])
self._logger.debug("track: %r", track)
# Album
if 'album' not in song:
@ -857,6 +857,18 @@ class MCGTrack:
class MCGPlaylistTrack(MCGTrack):
def __init__(self, artists, title, track, length, date, file, pos):
MCGTrack.__init__(self, artists, title, track, length, date, file)
self._pos = int(pos)
def get_pos(self):
return self._pos
class MCGConfig(configparser.ConfigParser):
CONFIG_DIR = '~/.config/mcg/'