You are not logged in.

#1 2009-11-13 19:34:14

trann
Member
Registered: 2009-10-29
Posts: 32

MPD/MPC Issue: Can't search by filename

So back when I used fedora, mpc could search by filename, but it appears that isn't the case for arch?  Mpc tells me that filename is not a valid search type.  It is a shame since I purposefully tag and rename my music files so that I can search by filename.

Any idea on how to get this functionality?  Songs are stored in an external harddrive that is symlinked to my Music folder in /home.  I suppose I could make a bash script that used find in that directory, but it seems silly to do that when I know there used to be support for this.

Thanks cool

Offline

#2 2009-11-13 19:50:46

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: MPD/MPC Issue: Can't search by filename

Same here, mpc even dropped "any"

"any" is not a valid search type: <Artist|Album|AlbumArtist|Title|Track|Name|Genre|Date|Composer|Performer|Comment|Disc|MUSICBRAINZ_ARTISTID|MUSICBRAINZ_ALBUMID|MUSICBRAINZ_ALBUMARTISTID|MUSICBRAINZ_TRACKID>

It still works fine in mpd, so you can install netcat and use:

function mpcs() { { echo search \"$1\" \"$2\"; echo close; } | nc localhost 6600; }

Or what I like to use, a combined `any` search on all parameters:

function mpcs() { { echo search any $(echo $* | sed 's/ / any /g'); echo close; } | nc localhost 6600; }

Offline

#3 2009-11-16 17:16:20

trann
Member
Registered: 2009-10-29
Posts: 32

Re: MPD/MPC Issue: Can't search by filename

Another oddity:  printing the mpc playlist does not give the id of the song.

Offline

#4 2009-11-16 17:26:43

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: MPD/MPC Issue: Can't search by filename

I never used mpc like that, so I don't know exactly what that looked like.

You could try:

{ echo playlistinfo; echo close; } | nc localhost 6600 | grep $'^file\n^Pos' | sed -n 'h;n;G;s/\n/\t/p'

Offline

#5 2009-11-16 17:29:50

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: MPD/MPC Issue: Can't search by filename

Actually, there is a file called mpdstate in ~/.mpd or /var/???
Take a look at that.

Offline

#6 2009-11-16 17:56:33

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: MPD/MPC Issue: Can't search by filename

trann wrote:

Another oddity:  printing the mpc playlist does not give the id of the song.

yeah, that broke a few of my scripts... annoying.

i have use one of two workarounds depending on the end goal

mpc playlist | cat -b           #  NNN  song info
mpc playlist | grep -n '.*'     # NNN:song info

there's also no indication of the currently playing track w/o putting another mpc command in the grep.

Last edited by brisbin33 (2009-11-16 17:57:25)

Offline

Board footer

Powered by FluxBB