Page 1 of 1

can't figure out search/find request format

Posted: February 16th, 2021, 2:18 pm
by sergi
Hi,

I'm trying to use the search command, but I always get an error in response. The old request format works, but I'm testing against MPD 0.21 and 0.22, so the new format should work too. What I'm trying:

Code: Select all

search  (artist contains "red" )
ACK [2@0] {search} '==' or '!=' expected
search  (artist contains "red")
ACK [5@0] {} Space expected after closing '"'
search  ( artist contains "red" )
ACK [2@0] {search} Word expected
search  ( "artist" contains "red" )
ACK [2@0] {search} Word expected
What's the proper request format? I can't figure it out and most implementations seem to use the old

Code: Select all

search artist "red"
format.

Re: can't figure out search/find request format

Posted: February 16th, 2021, 3:16 pm
by max
Let's look at this example:

Code: Select all

search  (artist contains "red" )
This is a "search" command with 4 parameters (separated by spaces):
  • "(artist"
  • "contains"
  • "red"
  • ")"
This doesn't look right, does it?
The filter expression must be exactly one argument (see https://www.musicpd.org/doc/html/protocol.html#filters). You forgot to quote the expression.