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

View File

@ -189,7 +189,6 @@ int taglib_read(const FILENAME_CHAR_T *filename, unsigned long id) {
if (m4afile->hasMP4Tag()) { if (m4afile->hasMP4Tag()) {
goPutTagType(id, MP4_TAG); goPutTagType(id, MP4_TAG);
has_tag = true; has_tag = true;
}
const auto itemListMap = m4afile->tag()->itemMap(); const auto itemListMap = m4afile->tag()->itemMap();
for (const auto item: itemListMap) { for (const auto item: itemListMap) {
@ -200,14 +199,17 @@ int taglib_read(const FILENAME_CHAR_T *filename, unsigned long id) {
} }
} }
} }
}
// WMA/ASF files may have additional tags not captured by the PropertyMap interface // WMA/ASF files may have additional tags not captured by the PropertyMap interface
TagLib::ASF::File *asfFile(dynamic_cast<TagLib::ASF::File *>(f.file())); TagLib::ASF::File *asfFile(dynamic_cast<TagLib::ASF::File *>(f.file()));
if (asfFile != NULL) { if (asfFile != NULL) {
const TagLib::ASF::Tag *asfTags{asfFile->tag()};
if (asfTags != NULL) {
goPutTagType(id, ASF_TAG); goPutTagType(id, ASF_TAG);
has_tag = true; has_tag = true;
const TagLib::ASF::Tag *asfTags{asfFile->tag()};
const auto itemListMap = asfTags->attributeListMap(); const auto itemListMap = asfTags->attributeListMap();
for (const auto item : itemListMap) { for (const auto item : itemListMap) {
char *key = const_cast<char*>(item.first.toCString(true)); char *key = const_cast<char*>(item.first.toCString(true));
@ -220,6 +222,7 @@ int taglib_read(const FILENAME_CHAR_T *filename, unsigned long id) {
} }
} }
} }
}
// Send all collected tags to the Go map // Send all collected tags to the Go map
for (TagLib::PropertyMap::ConstIterator i = tags.begin(); i != tags.end(); for (TagLib::PropertyMap::ConstIterator i = tags.begin(); i != tags.end();

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