check permissions for idle-command
This commit is contained in:
parent
f7517080cc
commit
743466bf80
1 changed files with 4 additions and 0 deletions
4
mcg.py
4
mcg.py
|
|
@ -105,6 +105,8 @@ class Client(Base):
|
||||||
PROTOCOL_COMPLETION = 'OK'
|
PROTOCOL_COMPLETION = 'OK'
|
||||||
# Protocol: error mark
|
# Protocol: error mark
|
||||||
PROTOCOL_ERROR = 'ACK '
|
PROTOCOL_ERROR = 'ACK '
|
||||||
|
# Protocol: error: permission
|
||||||
|
PROTOCOL_ERROR_PERMISSION = 4
|
||||||
# Signal: connection status
|
# Signal: connection status
|
||||||
SIGNAL_CONNECTION = 'connection'
|
SIGNAL_CONNECTION = 'connection'
|
||||||
# Signal: status
|
# Signal: status
|
||||||
|
|
@ -535,6 +537,8 @@ class Client(Base):
|
||||||
self._write(command, args)
|
self._write(command, args)
|
||||||
return self._read()
|
return self._read()
|
||||||
except MPDException as e:
|
except MPDException as e:
|
||||||
|
if command == 'idle' and e.get_error() == Client.PROTOCOL_ERROR_PERMISSION:
|
||||||
|
self.disconnect()
|
||||||
self._callback(Client.SIGNAL_ERROR, e)
|
self._callback(Client.SIGNAL_ERROR, e)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue