1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-12-22 14:05:18 +00:00

MPRIS: set several musicbrainz ids in metadata

This commit is contained in:
Chris Josten 2021-09-01 22:10:54 +02:00
parent 03bc3f795a
commit a89834044c

View file

@ -135,6 +135,20 @@ QVariantMap PlayerAdaptor::metadata() const
map[QStringLiteral("xesam:contentCreated")] = item->dateCreated();
map[QStringLiteral("xesam:genre")] = item->genres();
map[QStringLiteral("xesam:lastUsed")] = item->userData()->lastPlayedDate();
QJsonObject providers = item->providerIds();
if (providers.contains(QStringLiteral("MusicBrainzTrack"))) {
map[QStringLiteral("xesam:musicBrainzTrackID")] = providers[QStringLiteral("MusicBrainzTrack")].toString();
}
if (providers.contains(QStringLiteral("MusicBrainzAlbum"))) {
map[QStringLiteral("xesam:musicBrainzAlbumID")] = providers[QStringLiteral("MusicBrainzAlbum")].toString();
}
if (providers.contains(QStringLiteral("MusicBrainzArtist"))) {
map[QStringLiteral("xesam:musicBrainzArtistID")] = providers[QStringLiteral("MusicBrainzArtist")].toString();
}
if (providers.contains(QStringLiteral("MusicBrainzAlbumArtist"))) {
map[QStringLiteral("xesam:musicBrainzAlbumArtistID")] = providers[QStringLiteral("MusicBrainzAlbumArtist")].toString();
}
}
return map;
}