Result of prepare_change no longer affects whether a track is added to the history.

Update changelog and test cases.
This commit is contained in:
jcass 2015-12-07 07:53:34 +02:00
parent 139634b93b
commit fb7b466bee
3 changed files with 11 additions and 15 deletions

View File

@ -19,9 +19,9 @@ Bug fix release.
- MPD: Notify idling clients when a seek is performed. (Fixes: :issue:`1331`)
- Core: Fix :meth:`~mopidy.core.PlaybackController._change_track` to mark
track as playing and add it to the history if changing track while paused.
(Fixes: :issue:`1352`)
- Core: Fix bug in playback controller. If changing to another track while
the player is paused, the new track would not be added to the history or
marked as currently playing. (Fixes: :issue:`1352`)
v1.1.1 (2015-09-14)

View File

@ -211,9 +211,8 @@ class PlaybackController(object):
# code has already been killed in the gapless branch.
backend = self._get_backend()
if backend:
success = (
backend.playback.prepare_change().get and
backend.playback.change_track(tl_track.track).get())
backend.playback.prepare_change()
success = backend.playback.change_track(tl_track.track).get()
if success:
self.core.tracklist._mark_playing(tl_track)
self.core.history._add_track(tl_track.track)

View File

@ -813,20 +813,17 @@ class Bug1352RegressionTest(unittest.TestCase):
c = core.Core(config, mixer=None, backends=[b])
c.tracklist.add([track1, track2])
d = mock.Mock()
c.history._add_track = d
c.history._add_track = mock.PropertyMock()
c.tracklist._mark_playing = mock.PropertyMock()
e = mock.Mock()
c.tracklist._mark_playing = e
c.playback.play()
b.playback.change_track.reset_mock()
d.reset_mock()
e.reset_mock()
c.history._add_track.reset_mock()
c.tracklist._mark_playing.reset_mock()
c.playback.pause()
c.playback.next()
b.playback.change_track.assert_called_once_with(track2)
d.assert_called_once_with(track2)
e.assert_called_once_with(tl_track2)
c.history._add_track.assert_called_once_with(track2)
c.tracklist._mark_playing.assert_called_once_with(tl_track2)