Merge branch 'master' into gstreamer
This commit is contained in:
commit
c7690211c5
@ -25,8 +25,8 @@ Another great release.
|
||||
- Fixed ``play "-1"`` and ``playid "-1"`` behaviour when playlist is empty.
|
||||
- Support ``plchanges "-1"`` to work better with MPDroid.
|
||||
- Support ``pause`` without arguments to work better with MPDroid.
|
||||
- Support ``plchanges`` without quotes to work better with BitMPC.
|
||||
- Support ``play`` without quotes to work better with BitMPC.
|
||||
- Support ``plchanges``, ``play``, ``consume``, ``random``, ``repeat``, and
|
||||
``single`` without quotes to work better with BitMPC.
|
||||
|
||||
- Backend API:
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
from mopidy.frontends.mpd import (handle_pattern, MpdArgError, MpdNoExistError,
|
||||
MpdNotImplemented)
|
||||
|
||||
@handle_pattern(r'^consume (?P<state>[01])$')
|
||||
@handle_pattern(r'^consume "(?P<state>[01])"$')
|
||||
def consume(frontend, state):
|
||||
"""
|
||||
@ -224,6 +225,7 @@ def previous(frontend):
|
||||
"""
|
||||
return frontend.backend.playback.previous()
|
||||
|
||||
@handle_pattern(r'^random (?P<state>[01])$')
|
||||
@handle_pattern(r'^random "(?P<state>[01])"$')
|
||||
def random(frontend, state):
|
||||
"""
|
||||
@ -238,6 +240,7 @@ def random(frontend, state):
|
||||
else:
|
||||
frontend.backend.playback.random = False
|
||||
|
||||
@handle_pattern(r'^repeat (?P<state>[01])$')
|
||||
@handle_pattern(r'^repeat "(?P<state>[01])"$')
|
||||
def repeat(frontend, state):
|
||||
"""
|
||||
@ -319,6 +322,7 @@ def setvol(frontend, volume):
|
||||
volume = 100
|
||||
frontend.backend.mixer.volume = volume
|
||||
|
||||
@handle_pattern(r'^single (?P<state>[01])$')
|
||||
@handle_pattern(r'^single "(?P<state>[01])"$')
|
||||
def single(frontend, state):
|
||||
"""
|
||||
|
||||
@ -16,11 +16,21 @@ class PlaybackOptionsHandlerTest(unittest.TestCase):
|
||||
self.assertFalse(self.b.playback.consume)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_consume_off_without_quotes(self):
|
||||
result = self.h.handle_request(u'consume 0')
|
||||
self.assertFalse(self.b.playback.consume)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_consume_on(self):
|
||||
result = self.h.handle_request(u'consume "1"')
|
||||
self.assertTrue(self.b.playback.consume)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_consume_on_without_quotes(self):
|
||||
result = self.h.handle_request(u'consume 1')
|
||||
self.assertTrue(self.b.playback.consume)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_crossfade(self):
|
||||
result = self.h.handle_request(u'crossfade "10"')
|
||||
self.assert_(u'ACK [0@0] {} Not implemented' in result)
|
||||
@ -30,21 +40,41 @@ class PlaybackOptionsHandlerTest(unittest.TestCase):
|
||||
self.assertFalse(self.b.playback.random)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_random_off_without_quotes(self):
|
||||
result = self.h.handle_request(u'random 0')
|
||||
self.assertFalse(self.b.playback.random)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_random_on(self):
|
||||
result = self.h.handle_request(u'random "1"')
|
||||
self.assertTrue(self.b.playback.random)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_random_on_without_quotes(self):
|
||||
result = self.h.handle_request(u'random 1')
|
||||
self.assertTrue(self.b.playback.random)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_repeat_off(self):
|
||||
result = self.h.handle_request(u'repeat "0"')
|
||||
self.assertFalse(self.b.playback.repeat)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_repeat_off_without_quotes(self):
|
||||
result = self.h.handle_request(u'repeat 0')
|
||||
self.assertFalse(self.b.playback.repeat)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_repeat_on(self):
|
||||
result = self.h.handle_request(u'repeat "1"')
|
||||
self.assertTrue(self.b.playback.repeat)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_repeat_on_without_quotes(self):
|
||||
result = self.h.handle_request(u'repeat 1')
|
||||
self.assertTrue(self.b.playback.repeat)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_setvol_below_min(self):
|
||||
result = self.h.handle_request(u'setvol "-10"')
|
||||
self.assert_(u'OK' in result)
|
||||
@ -80,11 +110,21 @@ class PlaybackOptionsHandlerTest(unittest.TestCase):
|
||||
self.assertFalse(self.b.playback.single)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_single_off_without_quotes(self):
|
||||
result = self.h.handle_request(u'single 0')
|
||||
self.assertFalse(self.b.playback.single)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_single_on(self):
|
||||
result = self.h.handle_request(u'single "1"')
|
||||
self.assertTrue(self.b.playback.single)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_single_on_without_quotes(self):
|
||||
result = self.h.handle_request(u'single 1')
|
||||
self.assertTrue(self.b.playback.single)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_replay_gain_mode_off(self):
|
||||
result = self.h.handle_request(u'replay_gain_mode "off"')
|
||||
self.assert_(u'ACK [0@0] {} Not implemented' in result)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user