Mpd/mpc can be quite a bit annoying to configure.
As far as I know, you need to have all the audio/media (it will play the audio of some video formats) in a given folder (or symlink into that folder), and the "database" has to be up-to-date. It does update automatically periodically according to some settings probably.
Once you have this set up, the "standard", built-in way to command a certain song to play is "mpc tracknumber". And the problem is that unless you're like Rain Man, you have no way to tell beforehand.
As far as I know this is the only way, so, for similar reasons, I've made a humongous script that makes things somewhat easy, I'll type "mpcr keywords from the file name" (parhaps it "greps" from the tag, I don't remember).
It basically does a "mpc listall" with a format that I've set to more handily grep and "trim", so that I get the track number.
Here it is:
Code:
for i in $* ; do # search term parsing loop
a="$a grep -i $i |" # makes a chain of greps from the search terms
done
a="mpc playlist -f \"[(@(%position%)@) %artist% %title% %file%]\" | $a" # add a start to the grep chain
mpc play `shuf -e $(eval $(echo $a| sed 's/.\{2\}$//') | sed 's:)@).*::g' | sed 's:(@(::g') -n 1 `
I don't know why I did it that way anymore. I think it may not deal well with some characters like parenthesis and there also may be some issues with file names or titles including numbers. :-/
I called it "mpcr[andom]" because, as you can see by the "shuf" command, it will pick something random from the keywords I've used. If the input is restrictive enough, though, it will play an exact track, as there will be only one to "shuf".
I'm not sure if it will work for you to use exactly as it is with gpodder, because I don't use this program. In fact now that I think about it I wonder how it would deal with this sort of "percent variable". Perhaps you'd have to "sed" out "file://" or something, I don't know.
Incidentally, I listen to podcasts with mpc, but I've also created a helper script do more or less the opposite; to make the currently playing track open with either gmplayer or vlc, as they're far better to rewind back just a bit, at least without some GUI for mpc.
...
This thread reawakened my curiosity on whether only with such monstrosity we could do that, so I searched a little bit and it seems that indeed a script is needed. I've found another one, surely looks prettier than mine, with all the licensing header and sh*t:
Code:
#!/bin/sh
# Copyright 2011 H.Gökhan Sarı (email : th0th@returnfalse.net)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
FILTERS=$@
if [ ! -z "$FILTERS" ]; then
PLAYLIST=$(mpc --format "%position% %artist% - %title%" playlist)
FILTERED=$PLAYLIST
for FILTER in $FILTERS;
do
FILTERED=$(echo "$FILTERED"|egrep -i $FILTER)
done
FILTERED=$(echo "$FILTERED"|head -n 1)
set -- $FILTERED
mpc play $1
fi
From:
http://th0th.me/log/mpd-music-player...-jump-to-song/
Eventually I'll test/check out and to try to figure or test whether it have the same flaws or not.