MPC format search output

There are many, many clients for MPD. Many of them are old and unsupported, but maybe someone here can help you with them anyway...
Post Reply
tony
Posts: 3
Joined: February 3rd, 2015, 1:48 pm

MPC format search output

Post by tony » February 3rd, 2015, 2:22 pm

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

max
Forum team
Posts: 922
Joined: January 15th, 2013, 3:43 pm

Re: MPC format search output

Post by max » February 4th, 2015, 9:19 pm

Wrong parameter order. Read the mpc manual.

tony
Posts: 3
Joined: February 3rd, 2015, 1:48 pm

Re: MPC format search output

Post by tony » February 4th, 2015, 9:28 pm

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.

max
Forum team
Posts: 922
Joined: January 15th, 2013, 3:43 pm

Re: MPC format search output

Post by max » February 4th, 2015, 9:56 pm

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

tony
Posts: 3
Joined: February 3rd, 2015, 1:48 pm

Re: MPC format search output

Post by tony » February 4th, 2015, 10:32 pm

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?

Rasi
Forum team
Posts: 141
Joined: January 16th, 2013, 7:29 pm

Re: MPC format search output

Post by Rasi » March 14th, 2015, 12:38 pm

then your mpc might be too old. this was added in 0.26

Post Reply