parent
0da68e9b9e
commit
69cdb83bd1
1 changed files with 3 additions and 2 deletions
|
@ -63,8 +63,9 @@ class Player(gevent.Greenlet):
|
||||||
mpd_client = self._get_mpd()
|
mpd_client = self._get_mpd()
|
||||||
for song in songs:
|
for song in songs:
|
||||||
self.log.info('Adding {} to playlist'.format(song))
|
self.log.info('Adding {} to playlist'.format(song))
|
||||||
pos = min(1, len(mpd_client.playlistid()))
|
insert_pos = 0 if len(mpd_client.playlistid()) == 0 else \
|
||||||
mpd_client.addid(song, pos)
|
int(mpd_client.currentsong().get('pos', 0))
|
||||||
|
mpd_client.addid(song, insert_pos)
|
||||||
|
|
||||||
def _run(self):
|
def _run(self):
|
||||||
MpcWatcher(self.q, self.conf, client=None).start()
|
MpcWatcher(self.q, self.conf, client=None).start()
|
||||||
|
|
Loading…
Reference in a new issue