1
0

In OggFile.GetTag() was added another layer of indexing, this time we are looking for a capitalised tag name (e.g. Artist). Why there's no consistency in OGG vorbis tags..? *Sigh*

This commit is contained in:
Alexander Andreev 2023-10-08 01:23:28 +04:00
parent 0d8032da46
commit eb65071b51
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -74,7 +74,9 @@ func (of *OggFile) GetTag(tag string) string {
tagIdx := bytes.Index(of.bufHead, append([]byte{0, 0, 0}, (tag+"=")...)) tagIdx := bytes.Index(of.bufHead, append([]byte{0, 0, 0}, (tag+"=")...))
if tagIdx == -1 { if tagIdx == -1 {
if tagIdx = bytes.Index(of.bufHead, append([]byte{0, 0, 0}, (strings.ToUpper(tag)+"=")...)); tagIdx == -1 { if tagIdx = bytes.Index(of.bufHead, append([]byte{0, 0, 0}, (strings.ToUpper(tag)+"=")...)); tagIdx == -1 {
return "" if tagIdx = bytes.Index(of.bufHead, append([]byte{0, 0, 0}, (strings.Title(tag)+"=")...)); tagIdx == -1 {
return ""
}
} }
} }
tagIdx += 3 tagIdx += 3