musikr: parse APE tags on mpeg files, log ReplayGain values in debug

This commit is contained in:
jay
2026-11-12 19:27:33 -05:00
parent 208e48a97b
commit 66947b80bc
3 changed files with 25 additions and 0 deletions
+7
View File
@@ -94,6 +94,13 @@ void JMetadataBuilder::setId3v2(TagLib::ID3v2::Tag &tag) {
}
}
void JMetadataBuilder::setApe(TagLib::APE::Tag &tag) {
for (auto item : tag.itemListMap()) {
auto key = item.first.upper();
ape.add_custom(key, item.second.values());
}
}
void JMetadataBuilder::setXiph(TagLib::Ogg::XiphComment &tag) {
for (auto field : tag.fieldListMap()) {
auto key = field.first.upper();
+8
View File
@@ -51,6 +51,14 @@ bool parseMpeg(const std::string &name, TagLib::MPEG::File *mpegFile,
LOGE("Unable to parse ID3v2 tag in %s: %s", name.c_str(), e.what());
}
}
auto apeTag = mpegFile->APETag();
if (apeTag != nullptr) {
try {
jBuilder.setApe(*apeTag);
} catch (std::exception &e) {
LOGE("Unable to parse APE tag in %s: %s", name.c_str(), e.what());
}
}
return true;
}