Merge branch 'v1.0.x' of github.com:mopidy/mopidy into v1.0.x

Conflicts:
	docs/changelog.rst
This commit is contained in:
Thomas Adamcik 2015-06-24 22:12:09 +02:00
commit 9d087ff94d
3 changed files with 33 additions and 0 deletions

View File

@ -13,6 +13,9 @@ Bug fix release.
- Core/MPD/Local: Add support for ``title`` in
:meth:`mopidy.core.LibraryController.get_distinct`. (Fixes: :issue:`1181`)
- Core: Make sure track changes make it to audio while paused.
(Fixes: :issuse:`1177`)
v1.0.5 (2015-05-19)
===================

View File

@ -198,6 +198,12 @@ class PlaybackController(object):
if old_state == PlaybackState.PLAYING:
self._play(on_error_step=on_error_step)
elif old_state == PlaybackState.PAUSED:
# NOTE: this is just a quick hack to fix #1177 as this code has
# already been killed in the gapless branch.
backend = self._get_backend()
if backend:
backend.playback.prepare_change()
backend.playback.change_track(tl_track.track).get()
self.pause()
# TODO: this is not really end of track, this is on_need_next_track

View File

@ -668,3 +668,27 @@ class CorePlaybackWithOldBackendTest(unittest.TestCase):
c = core.Core(mixer=None, backends=[b])
c.tracklist.add([Track(uri='dummy1:a', length=40000)])
c.playback.play() # No TypeError == test passed.
b.playback.play.assert_called_once_with()
class Bug1177RegressionTest(unittest.TestCase):
def test(self):
b = mock.Mock()
b.uri_schemes.get.return_value = ['dummy']
b.playback = mock.Mock(spec=backend.PlaybackProvider)
b.playback.change_track.return_value.get.return_value = True
b.playback.play.return_value.get.return_value = True
track1 = Track(uri='dummy:a', length=40000)
track2 = Track(uri='dummy:b', length=40000)
c = core.Core(mixer=None, backends=[b])
c.tracklist.add([track1, track2])
c.playback.play()
b.playback.change_track.assert_called_once_with(track1)
b.playback.change_track.reset_mock()
c.playback.pause()
c.playback.next()
b.playback.change_track.assert_called_once_with(track2)