Page 1 of 1

MPC format search output

Posted: February 3rd, 2015, 2:22 pm
by tony
Hi, I am trying to use MPC to write a simple php control page and one of the options I would like to use is to search for a song or artist.

The problem I am having is that although the --format option seems to work fine when listing songs by artist or album etc it doesn't work when doing a search or a find.
If I add the option to the end of the line on a search (eg

Code: Select all

mpc find artist "Bad Company" --format "%title%"
) I get back:

Code: Select all

"--format" is not a valid search type: <any|Artist|Album|AlbumArtist|Title|Track|Name|Genre|Date|Composer|Performer|Comment|Disc|MUSICBRAINZ_ARTISTID|MUSICBRAINZ_ALBUMID|MUSICBRAINZ_ALBUMARTISTID|MUSICBRAINZ_TRACKID>
If I put the format option before search it is not applied and I just get a list of filenames back.

Does anyone know if there is a way of getting a formatted list back from the search option?

Or is this an MPD problem?

Thanks

Tony

Re: MPC format search output

Posted: February 4th, 2015, 9:19 pm
by max
Wrong parameter order. Read the mpc manual.

Re: MPC format search output

Posted: February 4th, 2015, 9:28 pm
by tony
what other order is there? I tried both, putting the format command first and then again with it at the end.

After reading a bit more it appears that the format does not apply to the search command.

Looks like I will have to write my own system to browse/search songs and just use mpc to play the playlist.

thanks for the help.

Re: MPC format search output

Posted: February 4th, 2015, 9:56 pm
by max
tony wrote:After reading a bit more it appears that the format does not apply to the search command.
Wrong.

Re: MPC format search output

Posted: February 4th, 2015, 10:32 pm
by tony
Thanks again for the very useful answer, however the man page has

Code: Select all

--format
Configure the format of song display for status and the playlist
for the format command.
Nowhere does it mention any other output than Status and Playlist.
Do you have access to another manual for mpc? can you supply the correct syntax for the command I wish to use?

Re: MPC format search output

Posted: March 14th, 2015, 12:38 pm
by Rasi
then your mpc might be too old. this was added in 0.26