Skip to content

Commit be83d68

Browse files
committed
fix(scanner): fix misleading custom tag split config message.
See #3901 (reply in thread) Signed-off-by: Deluan <deluan@navidrome.org>
1 parent c8915ec commit be83d68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

model/tag_mappings.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func compileSplitRegex(tagName TagName, split []string) *regexp.Regexp {
138138
escaped = append(escaped, regexp.QuoteMeta(s))
139139
}
140140
// If no valid separators remain, return the original value.
141-
if len(escaped) == 0 {
141+
if len(split) > 0 && len(escaped) == 0 {
142142
log.Warn("No valid separators found in split list", "split", split, "tag", tagName)
143143
return nil
144144
}
@@ -147,7 +147,7 @@ func compileSplitRegex(tagName TagName, split []string) *regexp.Regexp {
147147
pattern := "(?i)(" + strings.Join(escaped, "|") + ")"
148148
re, err := regexp.Compile(pattern)
149149
if err != nil {
150-
log.Error("Error compiling regexp", "pattern", pattern, "tag", tagName, "err", err)
150+
log.Warn("Error compiling regexp for split list", "pattern", pattern, "tag", tagName, "split", split, err)
151151
return nil
152152
}
153153
return re

0 commit comments

Comments
 (0)