fix(server): panic when logging tag type. Fix #3790

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-03-10 07:14:17 -04:00
parent 365df5220b
commit 5c67297dce
+4 -2
View File
@@ -55,6 +55,7 @@ func (c TagConf) SplitTagValue(values []string) []string {
type TagType string type TagType string
const ( const (
TagTypeString TagType = "string"
TagTypeInteger TagType = "int" TagTypeInteger TagType = "int"
TagTypeFloat TagType = "float" TagTypeFloat TagType = "float"
TagTypeDate TagType = "date" TagTypeDate TagType = "date"
@@ -113,8 +114,9 @@ func collectTags(tagMappings, normalized map[TagName]TagConf) {
aliases = append(aliases, strings.ToLower(val)) aliases = append(aliases, strings.ToLower(val))
} }
if v.Split != nil { if v.Split != nil {
if v.Type != "" { if v.Type != "" && v.Type != TagTypeString {
log.Error("Tag splitting only available for string types", "tag", k, "split", v.Split, "type", v.Type) log.Error("Tag splitting only available for string types", "tag", k, "split", v.Split,
"type", string(v.Type))
v.Split = nil v.Split = nil
} else { } else {
v.SplitRx = compileSplitRegex(k, v.Split) v.SplitRx = compileSplitRegex(k, v.Split)