Created a TracklistController to let it control wether if a track must be consumed or not
This commit is contained in:
parent
6e61f2ef85
commit
2c83225a1e
@ -148,8 +148,7 @@ class PlaybackController(object):
|
||||
else:
|
||||
self.stop(clear_current_track=True)
|
||||
|
||||
if self.core.tracklist.consume:
|
||||
self.core.tracklist.remove(tlid=original_tl_track.tlid)
|
||||
self.core.tracklist.mark_consumed(tlid=original_tl_track.tlid)
|
||||
|
||||
def on_tracklist_change(self):
|
||||
"""
|
||||
|
||||
@ -434,6 +434,19 @@ class TracklistController(object):
|
||||
"""
|
||||
return self._tl_tracks[start:end]
|
||||
|
||||
def mark_consumed(self, **kwargs):
|
||||
"""
|
||||
Marks the given track as played.
|
||||
|
||||
:param tl_track: Track to mark
|
||||
:type tl_track: :class:`mopidy.models.TlTrack`
|
||||
:rtype: True if the track was actually removed from the tracklist
|
||||
"""
|
||||
if not self.consume:
|
||||
return False
|
||||
self.remove(**kwargs)
|
||||
return True
|
||||
|
||||
def _trigger_tracklist_changed(self):
|
||||
self._first_shuffle = True
|
||||
self._shuffled = []
|
||||
|
||||
Loading…
Reference in New Issue
Block a user