mpd: Ignore empty parts in query
This is to fix e.g. that an empty string can't be parsed as a date, which may be attempted if the query contains 'Date ""'.
This commit is contained in:
parent
47ca709c6a
commit
acb0e47909
@ -41,7 +41,9 @@ def _query_from_mpd_search_parameters(parameters, mapping):
|
||||
raise exceptions.MpdArgError('incorrect arguments')
|
||||
if not parameters:
|
||||
raise ValueError
|
||||
query.setdefault(field, []).append(parameters.pop(0))
|
||||
value = parameters.pop(0)
|
||||
if value:
|
||||
query.setdefault(field, []).append(value)
|
||||
return query
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user