diff options
| -rw-r--r-- | src/plugins/General/mpris/mpris2/player2object.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/General/mpris/mpris2/player2object.cpp b/src/plugins/General/mpris/mpris2/player2object.cpp index 94ecca20f..f5af555e6 100644 --- a/src/plugins/General/mpris/mpris2/player2object.cpp +++ b/src/plugins/General/mpris/mpris2/player2object.cpp @@ -126,8 +126,8 @@ QVariantMap Player2Object::metadata() const map["mpris:length"] = qMax(m_core->totalTime() * 1000 , qint64(0)); if(!MetaDataManager::instance()->getCoverPath(m_core->metaData(Qmmp::URL)).isEmpty()) { - map["mpris:artUrl"] = QString("file://") + - MetaDataManager::instance()->getCoverPath(m_core->metaData(Qmmp::URL)); + map["mpris:artUrl"] = QUrl::fromLocalFile( + MetaDataManager::instance()->getCoverPath(m_core->metaData(Qmmp::URL))).toString(); } if(!m_core->metaData(Qmmp::ALBUM).isEmpty()) map["xesam:album"] = m_core->metaData(Qmmp::ALBUM); @@ -146,7 +146,10 @@ QVariantMap Player2Object::metadata() const if(!m_core->metaData(Qmmp::TRACK).isEmpty()) map["xesam:trackNumber"] = m_core->metaData(Qmmp::TRACK).toInt(); map["mpris:trackid"] = QVariant::fromValue<QDBusObjectPath>(m_trackID); - map["xesam:url"] = m_core->metaData(Qmmp::URL); + if(m_core->metaData(Qmmp::URL).startsWith("/")) + map["xesam:url"] = QUrl::fromLocalFile(m_core->metaData(Qmmp::URL)).toString(); + else + map["xesam:url"] = m_core->metaData(Qmmp::URL); return map; } |
