fix changing of song by storing playlist position for each track (fixes #1)
This commit is contained in:
parent
1bc7070231
commit
da06f1fff5
2 changed files with 16 additions and 4 deletions
14
mcg/mcg.py
14
mcg/mcg.py
|
|
@ -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/'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue