Merge pull request #1062 from jodal/fix/1058-private-tracklist-mark-methods
core: Make tracklist.mark_*() private
This commit is contained in:
commit
18b8af8f38
@ -56,6 +56,13 @@ v1.0.0 (UNRELEASED)
|
||||
:meth:`mopidy.core.PlaybackController.get_stream_title` for letting clients
|
||||
know about the current song in streams. (PR: :issue:`938`, :issue:`1030`)
|
||||
|
||||
- The following methods were documented as internal. They are now fully private
|
||||
and unavailable outside the core actor. (Fixes: :issue:`1058`)
|
||||
|
||||
- :meth:`mopidy.core.TracklistController.mark_played`
|
||||
- :meth:`mopidy.core.TracklistController.mark_playing`
|
||||
- :meth:`mopidy.core.TracklistController.mark_unplayable`
|
||||
|
||||
**Backend API**
|
||||
|
||||
- Remove default implementation of
|
||||
|
||||
@ -220,7 +220,7 @@ class PlaybackController(object):
|
||||
self.stop()
|
||||
self.set_current_tl_track(None)
|
||||
|
||||
self.core.tracklist.mark_played(original_tl_track)
|
||||
self.core.tracklist._mark_played(original_tl_track)
|
||||
|
||||
def on_tracklist_change(self):
|
||||
"""
|
||||
@ -255,7 +255,7 @@ class PlaybackController(object):
|
||||
self.stop()
|
||||
self.set_current_tl_track(None)
|
||||
|
||||
self.core.tracklist.mark_played(original_tl_track)
|
||||
self.core.tracklist._mark_played(original_tl_track)
|
||||
|
||||
def pause(self):
|
||||
"""Pause playback."""
|
||||
@ -311,12 +311,12 @@ class PlaybackController(object):
|
||||
success = backend and backend.playback.play(tl_track.track).get()
|
||||
|
||||
if success:
|
||||
self.core.tracklist.mark_playing(tl_track)
|
||||
self.core.tracklist._mark_playing(tl_track)
|
||||
self.core.history.add(tl_track.track)
|
||||
# TODO: replace with stream-changed
|
||||
self._trigger_track_playback_started()
|
||||
else:
|
||||
self.core.tracklist.mark_unplayable(tl_track)
|
||||
self.core.tracklist._mark_unplayable(tl_track)
|
||||
if on_error_step == 1:
|
||||
# TODO: can cause an endless loop for single track repeat.
|
||||
self.next()
|
||||
|
||||
@ -499,19 +499,19 @@ class TracklistController(object):
|
||||
"""
|
||||
return self._tl_tracks[start:end]
|
||||
|
||||
def mark_playing(self, tl_track):
|
||||
"""Method for :class:`mopidy.core.PlaybackController`. **INTERNAL**"""
|
||||
def _mark_playing(self, tl_track):
|
||||
"""Internal method for :class:`mopidy.core.PlaybackController`."""
|
||||
if self.get_random() and tl_track in self._shuffled:
|
||||
self._shuffled.remove(tl_track)
|
||||
|
||||
def mark_unplayable(self, tl_track):
|
||||
"""Method for :class:`mopidy.core.PlaybackController`. **INTERNAL**"""
|
||||
def _mark_unplayable(self, tl_track):
|
||||
"""Internal method for :class:`mopidy.core.PlaybackController`."""
|
||||
logger.warning('Track is not playable: %s', tl_track.track.uri)
|
||||
if self.get_random() and tl_track in self._shuffled:
|
||||
self._shuffled.remove(tl_track)
|
||||
|
||||
def mark_played(self, tl_track):
|
||||
"""Method for :class:`mopidy.core.PlaybackController`. **INTERNAL**"""
|
||||
def _mark_played(self, tl_track):
|
||||
"""Internal method for :class:`mopidy.core.PlaybackController`."""
|
||||
if self.consume and tl_track is not None:
|
||||
self.remove(tlid=[tl_track.tlid])
|
||||
return True
|
||||
|
||||
Loading…
Reference in New Issue
Block a user