MPD: Remove some commands from the 'commands' output, as MPD does not list them and GMPC fails if 'idle' is present in the list
This commit is contained in:
parent
bcc133a079
commit
a8672eb87b
@ -1107,7 +1107,20 @@ class MpdFrontend(object):
|
||||
|
||||
As permissions is not implemented, any user has access to all commands.
|
||||
"""
|
||||
return [('command', c) for c in sorted(list(_commands))]
|
||||
commands = sorted(list(_commands))
|
||||
|
||||
# Added by Mopidy. Not a part of the MPD protocol.
|
||||
commands.remove('ack')
|
||||
|
||||
# Not shown by MPD in its command list
|
||||
commands.remove('command_list_begin')
|
||||
commands.remove('command_list_ok_begin')
|
||||
commands.remove('command_list_end')
|
||||
commands.remove('idle')
|
||||
commands.remove('noidle')
|
||||
commands.remove('sticker')
|
||||
|
||||
return [('command', c) for c in commands]
|
||||
|
||||
@handle_pattern(r'^decoders$')
|
||||
def _reflection_decoders(self):
|
||||
|
||||
@ -1186,9 +1186,18 @@ class ReflectionHandlerTest(unittest.TestCase):
|
||||
|
||||
def test_commands_returns_list_of_all_commands(self):
|
||||
result = self.h.handle_request(u'commands')
|
||||
# Check if some random commands are included
|
||||
self.assert_(u'command: commands' in result)
|
||||
self.assert_(u'command: play' in result)
|
||||
self.assert_(u'command: status' in result)
|
||||
# Check if the blacklisted commands are not present
|
||||
self.assert_(u'command: ack' not in result)
|
||||
self.assert_(u'command: command_list_begin' not in result)
|
||||
self.assert_(u'command: command_list_ok_begin' not in result)
|
||||
self.assert_(u'command: command_list_end' not in result)
|
||||
self.assert_(u'command: idle' not in result)
|
||||
self.assert_(u'command: noidle' not in result)
|
||||
self.assert_(u'command: sticker' not in result)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_decoders(self):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user