address feedback round 1

This commit is contained in:
Kendall Garner 2025-08-01 21:52:21 -07:00
parent 6b89ea00e5
commit d6114df91f
No known key found for this signature in database
GPG Key ID: 9355F387FE765C94
3 changed files with 23 additions and 24 deletions

View File

@ -279,11 +279,7 @@ var _ = Describe("Extractor", func() {
Describe("tags", func() {
DescribeTable("test metadata tags across files, and special cases", func(file string, tags ...string) {
mf := parseTestFile("tests/fixtures/" + file)
metadataTags := mf.Tags[model.TagMetadataTag]
Expect(metadataTags).To(HaveLen(len(tags)))
for _, tag := range tags {
Expect(mf.Tags[model.TagMetadataTag]).To(ContainElement(tag))
}
Expect(mf.Tags[model.TagMetadataTag]).To(ConsistOf(tags))
},
// weirder cases
Entry("file with multiple tags", "ape-v1-v2.mp3", "ape", "id3v1", "id3v2"),

View File

@ -189,14 +189,14 @@ int taglib_read(const FILENAME_CHAR_T *filename, unsigned long id) {
if (m4afile->hasMP4Tag()) {
goPutTagType(id, MP4_TAG);
has_tag = true;
}
const auto itemListMap = m4afile->tag()->itemMap();
for (const auto item: itemListMap) {
char *key = const_cast<char*>(item.first.toCString(true));
for (const auto value: item.second.toStringList()) {
char *val = const_cast<char*>(value.toCString(true));
goPutM4AStr(id, key, val);
const auto itemListMap = m4afile->tag()->itemMap();
for (const auto item: itemListMap) {
char *key = const_cast<char*>(item.first.toCString(true));
for (const auto value: item.second.toStringList()) {
char *val = const_cast<char*>(value.toCString(true));
goPutM4AStr(id, key, val);
}
}
}
}
@ -204,19 +204,22 @@ int taglib_read(const FILENAME_CHAR_T *filename, unsigned long id) {
// WMA/ASF files may have additional tags not captured by the PropertyMap interface
TagLib::ASF::File *asfFile(dynamic_cast<TagLib::ASF::File *>(f.file()));
if (asfFile != NULL) {
goPutTagType(id, ASF_TAG);
has_tag = true;
const TagLib::ASF::Tag *asfTags{asfFile->tag()};
const auto itemListMap = asfTags->attributeListMap();
for (const auto item : itemListMap) {
char *key = const_cast<char*>(item.first.toCString(true));
for (auto j = item.second.begin();
j != item.second.end(); ++j) {
if (asfTags != NULL) {
goPutTagType(id, ASF_TAG);
has_tag = true;
char *val = const_cast<char*>(j->toString().toCString(true));
goPutStr(id, key, val);
const auto itemListMap = asfTags->attributeListMap();
for (const auto item : itemListMap) {
char *key = const_cast<char*>(item.first.toCString(true));
for (auto j = item.second.begin();
j != item.second.end(); ++j) {
char *val = const_cast<char*>(j->toString().toCString(true));
goPutStr(id, key, val);
}
}
}
}
@ -303,7 +306,7 @@ char has_cover(const TagLib::FileRef f) {
hasCover = !frameListMap["APIC"].isEmpty();
}
}
// ----- AIFF
// ----- AIFF
else if (TagLib::RIFF::AIFF::File * aiffFile{ dynamic_cast<TagLib::RIFF::AIFF::File *>(f.file())}) {
if (aiffFile->hasID3v2Tag()) {
const auto& frameListMap{ aiffFile->tag()->frameListMap() };

View File

@ -202,7 +202,7 @@ main:
# Additional tags. You can add new tags without the need to modify the code. They will be available as fields
# for smart playlists
additional:
# Internal tag type, reprentes medatada tag(s) found in the file
# Internal tag type, represents metadata tag(s) found in the file
tags:
aliases: [ __tags ]
asin: