Reputation: 788
I am using Python MPD2, is there a way to return the name of the currently selected playlist?
Thanks, Mark.
Upvotes: 1
Views: 1335
Reputation: 21
My solution in bash:
CURRENT="$(mpc -f "%file%" playlist | sha512sum )"
mpc lsplaylist | while read line
do
i="$(mpc -f "%file%" playlist $line | sha512sum )"
if [ "$i" = "$CURRENT" ]; then
echo "Current playlist is $line"
fi
done
Upvotes: 2
Reputation: 788
After more searching, I finally posted on the musicpd forum
https://forum.musicpd.org/viewtopic.php?f=7&t=4034
and the response was:
"MPD does not remember of the most recently loaded playlist's name, so there's no way to query it.".
Upvotes: 1