ListenBrainzScrobbler: Split work mbids

This commit is contained in:
Jonas Kvinge 2024-09-02 23:46:13 +02:00
parent 552440f50e
commit c77c7a247a
1 changed files with 6 additions and 1 deletions

View File

@ -437,7 +437,12 @@ QJsonObject ListenBrainzScrobbler::JsonTrackMetadata(const ScrobbleMetadata &met
object_additional_info.insert(QLatin1String("track_mbid"), metadata.musicbrainz_track_id);
}
if (!metadata.musicbrainz_work_id.isEmpty()) {
object_additional_info.insert(QLatin1String("work_mbids"), QJsonArray() << metadata.musicbrainz_work_id);
const QStringList musicbrainz_work_id_list = metadata.musicbrainz_work_id.split(QLatin1Char('/'));
QJsonArray array_musicbrainz_work_id;
for (const QString &musicbrainz_work_id : musicbrainz_work_id_list) {
array_musicbrainz_work_id << musicbrainz_work_id;
}
object_additional_info.insert(QLatin1String("work_mbids"), array_musicbrainz_work_id);
}
object_track_metadata.insert(QLatin1String("additional_info"), object_additional_info);