【问题标题】:MPD, How to get the name of the current playlist?MPD,如何获取当前播放列表的名称?
【发布时间】:2017-03-25 10:27:45
【问题描述】:

我正在使用 Python MPD2,有没有办法返回当前选择的播放列表的名称?

谢谢,马克。

【问题讨论】:

    标签: python-2.7 mpd


    【解决方案1】:

    经过多方搜索,我终于在musicpd论坛发帖了

    https://forum.musicpd.org/viewtopic.php?f=7&t=4034

    得到的回应是:

    “MPD 不记得最近加载的播放列表的名称,因此无法查询。”。

    【讨论】:

      【解决方案2】:

      我在 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
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-12-14
        • 1970-01-01
        • 2019-07-27
        • 2016-12-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多