mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
address feedback round 1
This commit is contained in:
parent
6b89ea00e5
commit
d6114df91f
@ -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"),
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user