mpd: 'list "artist" ""' should not generate an invalid query

This commit is contained in:
Thomas Adamcik 2015-04-13 00:02:00 +02:00
parent 97515c8125
commit 8c7a9e3f95

View File

@ -270,10 +270,12 @@ def list_(context, *args):
if field not in _LIST_MAPPING:
raise exceptions.MpdArgError('incorrect arguments')
query = None
if len(params) == 1:
if field != 'album':
raise exceptions.MpdArgError('should be "Album" for 3 arguments')
query = {'artist': params}
if params[0].strip():
query = {'artist': params}
else:
try:
query = _query_from_mpd_search_parameters(params, _LIST_MAPPING)