From 6e2baebcf5e60ea97697b099814c4a99f82100dc Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 1 Jan 2013 15:49:41 +0000 Subject: mpris2: fixed url git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3114 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/mpris/mpris2/player2object.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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(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; } -- cgit v1.2.3-13-gbd6f