MPD: Support 'playid 0' without quotes around id
This commit is contained in:
parent
0800e86a05
commit
6451519d2a
@ -121,8 +121,8 @@ def play(context):
|
||||
"""
|
||||
return context.backend.playback.play().get()
|
||||
|
||||
@handle_request(r'^playid "(?P<cpid>\d+)"$')
|
||||
@handle_request(r'^playid "(?P<cpid>-1)"$')
|
||||
@handle_request(r'^playid (?P<cpid>-?\d+)$')
|
||||
@handle_request(r'^playid "(?P<cpid>-?\d+)"$')
|
||||
def playid(context, cpid):
|
||||
"""
|
||||
*musicpd.org, playback section:*
|
||||
|
||||
@ -287,6 +287,13 @@ class PlaybackControlHandlerTest(protocol.BaseTestCase):
|
||||
self.assertEqual(PLAYING, self.backend.playback.state.get())
|
||||
self.assertInResponse(u'OK')
|
||||
|
||||
def test_playid_without_quotes(self):
|
||||
self.backend.current_playlist.append([Track()])
|
||||
|
||||
self.sendRequest(u'playid 0')
|
||||
self.assertEqual(PLAYING, self.backend.playback.state.get())
|
||||
self.assertInResponse(u'OK')
|
||||
|
||||
def test_playid_minus_one_plays_first_in_playlist_if_no_current_track(self):
|
||||
self.assertEqual(self.backend.playback.current_track.get(), None)
|
||||
self.backend.current_playlist.append([Track(uri='a'), Track(uri='b')])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user