change playlist when changing continous_audiospec
This commit is contained in:
parent
949efa096c
commit
fd1e746cea
1 changed files with 10 additions and 0 deletions
|
@ -75,6 +75,16 @@ class Player:
|
|||
self._continous_audiospec = self.conf['CONTINOUS_AUDIOSPEC'] \
|
||||
if spec is None else spec
|
||||
|
||||
def clear_everything_but_current_song():
|
||||
mpd = self._get_mpd()
|
||||
current = mpd.currentsong()
|
||||
pos = int(current.get('pos', 0))
|
||||
for song in mpd.playlistid():
|
||||
if int(song['pos']) != pos:
|
||||
mpd.deleteid(song['id'])
|
||||
|
||||
gevent.Greenlet.spawn(clear_everything_but_current_song)
|
||||
|
||||
def check_playlist(self):
|
||||
mpd_client = self._get_mpd()
|
||||
songs = mpd_client.playlist()
|
||||
|
|
Loading…
Reference in a new issue