Commit 1be4bb88 authored by Denis Sheremet's avatar Denis Sheremet Committed by Kai Uwe Broulik

[Media Controller] Multiple artists support

According to the spec, xesam:artist should be a string array, but
majority of players uses string instead. This patch adds support for
both string array and string options to allow new software development
according to the spec but also maintain compatibility with existing
solutions.

BUG: 405762
FIXED-IN: 5.17.1

Differential Revision: https://phabricator.kde.org/D24740
parent ff84a4e5
......@@ -49,7 +49,21 @@ Item {
var lastUrlPart = xesamUrl.substring(lastSlashPos + 1)
return decodeURIComponent(lastUrlPart)
}
property string artist: currentMetadata ? currentMetadata["xesam:artist"] || "" : ""
property string artist: {
if (!currentMetadata) {
return ""
}
var xesamArtist = currentMetadata["xesam:artist"]
if (!xesamArtist) {
return "";
}
if (typeof xesamArtist == "string") {
return xesamArtist
} else {
return xesamArtist.join(", ")
}
}
property string albumArt: currentMetadata ? currentMetadata["mpris:artUrl"] || "" : ""
readonly property string identity: !root.noPlayer ? mpris2Source.currentData.Identity || mpris2Source.current : ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment