1

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

Thanks, Mark.

Cool Javelin
  • 776
  • 2
  • 10
  • 26

2 Answers2

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
stosem
  • 21
  • 2
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.".

Cool Javelin
  • 776
  • 2
  • 10
  • 26