0

I am using Python MPD2, is there a way to return the name of the currently selected playlist?

Thanks, Mark.

4

2 回答 2

2

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
于 2018-08-09T12:57:04.793 回答
1

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.".

于 2016-11-16T01:46:03.403 回答