Allow searching songs by filepath, for songs without Title

This commit is contained in:
Deluan
2024-09-13 18:04:21 -04:00
parent 47872c9e8a
commit e8d0f2ec2c
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -11,7 +11,8 @@ import (
"github.com/navidrome/navidrome/conf"
)
var quotesRegex = regexp.MustCompile("[“”‘’'\"\\[\\(\\{\\]\\)\\}]")
var quotesRegex = regexp.MustCompile("[“”‘’'\"\\[({\\])}]")
var slashRemover = strings.NewReplacer("\\", " ", "/", " ")
func SanitizeStrings(text ...string) string {
sanitizedText := strings.Builder{}
@@ -25,6 +26,7 @@ func SanitizeStrings(text ...string) string {
var fullText []string
for w := range words {
w = quotesRegex.ReplaceAllString(w, "")
w = slashRemover.Replace(w)
if w != "" {
fullText = append(fullText, w)
}