18 QByteArray fname =
filename.toLocal8Bit();
19 auto *oggfile =
new TagLib::Ogg::Vorbis::File(fname.constData());
21 if (!oggfile->isOpen())
49 TagLib::Ogg::XiphComment *tag = oggfile->tag();
62 tag->addField(
"MUSICBRAINZ_ALBUMARTISTID",
64 tag->addField(
"COMPILATION_ARTIST",
70 if (tag->contains(
"MUSICBRAINZ_ALBUMARTISTID") &&
71 (tag->fieldListMap()[
"MUSICBRAINZ_ALBUMARTISTID"].toString() ==
74 tag->removeFields(
"MUSICBRAINZ_ALBUMARTISTID");
76 tag->removeFields(
"COMPILATION_ARTIST");
80 bool result = oggfile->save();
98 TagLib::Ogg::XiphComment *tag = oggfile->tag();
110 bool compilation =
false;
112 if (tag->contains(
"COMPILATION_ARTIST"))
114 QString compilation_artist = TStringToQString(
115 tag->fieldListMap()[
"COMPILATION_ARTIST"].toString()).trimmed();
116 if (compilation_artist != metadata->Artist())
118 metadata->setCompilationArtist(compilation_artist);
123 if (!compilation && tag->contains(
"MUSICBRAINZ_ALBUMARTISTID"))
125 QString musicbrainzcode = TStringToQString(
126 tag->fieldListMap()[
"MUSICBRAINZ_ALBUMARTISTID"].toString()).trimmed();
131 metadata->setCompilation(compilation);
133 if (metadata->Length() <= 0ms)