plugins/mpris*: "xesam:artist" is of stringlist type

Fix the type in metadata, but still use string type in network packets.
This commit is contained in:
Fushan Wen 2023-03-25 22:13:31 +08:00
parent 87a608136f
commit 47c6f5b768
No known key found for this signature in database
GPG key ID: 2E48D1487C91DCAA
2 changed files with 2 additions and 2 deletions

View file

@ -374,7 +374,7 @@ void MprisControlPlugin::sendPlayerList()
void MprisControlPlugin::mprisPlayerMetadataToNetworkPacket(NetworkPacket &np, const QVariantMap &nowPlayingMap) const
{
QString title = nowPlayingMap[QStringLiteral("xesam:title")].toString();
QString artist = nowPlayingMap[QStringLiteral("xesam:artist")].toString();
QString artist = nowPlayingMap[QStringLiteral("xesam:artist")].toStringList().join(QLatin1String(", "));
QString album = nowPlayingMap[QStringLiteral("xesam:album")].toString();
QString albumArtUrl = nowPlayingMap[QStringLiteral("mpris:artUrl")].toString();
QUrl fileUrl = nowPlayingMap[QStringLiteral("xesam:url")].toUrl();

View file

@ -55,7 +55,7 @@ QVariantMap MprisRemotePlayerMediaPlayer2Player::Metadata() const
metadata[QStringLiteral("xesam:title")] = m_parent->title();
}
if (!m_parent->artist().isEmpty()) {
metadata[QStringLiteral("xesam:artist")] = m_parent->artist();
metadata[QStringLiteral("xesam:artist")] = QStringList{m_parent->artist()};
}
if (!m_parent->album().isEmpty()) {
metadata[QStringLiteral("xesam:album")] = m_parent->album();