fix(scanner): fix misleading custom tag split config message.
See https://github.com/navidrome/navidrome/discussions/3901#discussioncomment-13883185 Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -138,7 +138,7 @@ func compileSplitRegex(tagName TagName, split []string) *regexp.Regexp {
|
|||||||
escaped = append(escaped, regexp.QuoteMeta(s))
|
escaped = append(escaped, regexp.QuoteMeta(s))
|
||||||
}
|
}
|
||||||
// If no valid separators remain, return the original value.
|
// If no valid separators remain, return the original value.
|
||||||
if len(escaped) == 0 {
|
if len(split) > 0 && len(escaped) == 0 {
|
||||||
log.Warn("No valid separators found in split list", "split", split, "tag", tagName)
|
log.Warn("No valid separators found in split list", "split", split, "tag", tagName)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@ func compileSplitRegex(tagName TagName, split []string) *regexp.Regexp {
|
|||||||
pattern := "(?i)(" + strings.Join(escaped, "|") + ")"
|
pattern := "(?i)(" + strings.Join(escaped, "|") + ")"
|
||||||
re, err := regexp.Compile(pattern)
|
re, err := regexp.Compile(pattern)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Error compiling regexp", "pattern", pattern, "tag", tagName, "err", err)
|
log.Warn("Error compiling regexp for split list", "pattern", pattern, "tag", tagName, "split", split, err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return re
|
return re
|
||||||
|
|||||||
Reference in New Issue
Block a user