Send OK only when no ACK in command list

This commit is contained in:
Johannes Knutsen 2010-02-14 01:19:21 +01:00
parent 8c983f2014
commit 527d345488

View File

@ -66,7 +66,7 @@ class MpdHandler(object):
response.append(u'%s: %s' % (key, value))
else:
response.append(line)
if add_ok:
if add_ok and (not response or not response[-1].startswith(u'ACK')):
response.append(u'OK')
return response
@ -109,6 +109,8 @@ class MpdHandler(object):
response = self.handle_request(command, add_ok=False)
if response is not None:
result.append(response)
if response and response[-1].startswith(u'ACK'):
return result
if command_list_ok:
response.append(u'list_OK')
return result