diff --git a/mopidy/core/actor.py b/mopidy/core/actor.py index 7b457ac1..e6c76789 100644 --- a/mopidy/core/actor.py +++ b/mopidy/core/actor.py @@ -197,7 +197,8 @@ class Core( - 'tracklist' fill the tracklist - 'mode' set tracklist properties (consume, random, repeat, single) - - 'autoplay' start playing ('tracklist' also required) + - 'play-last' restore play state ('tracklist' also required) + - 'play-always' start playing ('tracklist' also required) - 'mixer' set mixer volume and mute state - 'history' restore history diff --git a/mopidy/core/history.py b/mopidy/core/history.py index a6b4c817..14d847b3 100644 --- a/mopidy/core/history.py +++ b/mopidy/core/history.py @@ -70,7 +70,7 @@ class HistoryController(object): timestamp=timestamp, track=track)) count += 1 if count_max < count: - logger.info('Limit history to %s tracks.', count_max) + logger.info('Limiting history to %s tracks.', count_max) break return HistoryState(history=history_list) @@ -79,5 +79,4 @@ class HistoryController(object): if state: if 'history' in coverage: self._history = [] - for htrack in state.history: - self._history.append((htrack.timestamp, htrack.track)) + self._history = [(h.timestamp, h.track) for h in state.history] diff --git a/mopidy/core/playback.py b/mopidy/core/playback.py index b569aebf..3df18b0b 100644 --- a/mopidy/core/playback.py +++ b/mopidy/core/playback.py @@ -29,7 +29,7 @@ class PlaybackController(object): self._last_position = None self._previous = False - self._start_at_pos = None + self._start_at_position = None self._start_paused = False if self._audio: @@ -229,9 +229,9 @@ class PlaybackController(object): self.set_state(PlaybackState.PLAYING) self._trigger_track_playback_started() seek_ok = False - if self._start_at_pos: - seek_ok = self.seek(self._start_at_pos) - self._start_at_pos = None + if self._start_at_position: + seek_ok = self.seek(self._start_at_position) + self._start_at_position = None if not seek_ok and self._start_paused: self.pause() self._start_paused = False @@ -615,9 +615,8 @@ class PlaybackController(object): if 'play-last' in coverage: new_state = state.state if state.tlid is not None: - if PlaybackState.PAUSED == new_state: + if new_state == PlaybackState.PAUSED: self._start_paused = True - if (PlaybackState.PLAYING == new_state or - PlaybackState.PAUSED == new_state): - self._start_at_pos = state.position + if new_state in (PlaybackState.PLAYING, PlaybackState.PAUSED): + self._start_at_position = state.position self.play(tlid=state.tlid)