Call on_current_playlist_change whenever the current playlist changes

This commit is contained in:
Stein Magnus Jodal 2010-08-14 23:52:56 +02:00
parent 79eb5028ca
commit bb712a6d6e

View File

@ -66,10 +66,9 @@ class BaseCurrentPlaylistController(object):
def clear(self):
"""Clear the current playlist."""
self.backend.playback.stop()
self.backend.playback.current_cp_track = None
self._cp_tracks = []
self.version += 1
self.backend.playback.on_current_playlist_change()
def get(self, **criteria):
"""
@ -147,6 +146,7 @@ class BaseCurrentPlaylistController(object):
to_position += 1
self._cp_tracks = new_cp_tracks
self.version += 1
self.backend.playback.on_current_playlist_change()
def remove(self, **criteria):
"""
@ -191,6 +191,7 @@ class BaseCurrentPlaylistController(object):
random.shuffle(shuffled)
self._cp_tracks = before + shuffled + after
self.version += 1
self.backend.playback.on_current_playlist_change()
def mpd_format(self, *args, **kwargs):
"""Not a part of the generic backend API."""