Skip to content

🎧 Your Personal Streaming Service

Ignore brackets in search

Deluanaaa4f1531e24
diff --git a/persistence/sql_search.go b/persistence/sql_search.go
index 2359e5363..55c5b8582 100644
--- a/persistence/sql_search.go
+++ b/persistence/sql_search.go
@@ -9,7 +9,7 @@ import (
"github.com/kennygrant/sanitize"
)
-var quotesRegex = regexp.MustCompile("[β€œβ€β€˜β€™'\"]")
+var quotesRegex = regexp.MustCompile("[β€œβ€β€˜β€™'\"\\[\\(\\{\\]\\)\\}]")
func getFullText(text ...string) string {
fullText := sanitizeStrings(text...)
diff --git a/persistence/sql_search_test.go b/persistence/sql_search_test.go
index 11a846663..231528aaf 100644
--- a/persistence/sql_search_test.go
+++ b/persistence/sql_search_test.go
@@ -26,5 +26,9 @@ var _ = Describe("sqlRepository", func() {
It("remove symbols", func() {
Expect(getFullText("Tom’s Diner ' β€œ40” β€˜A’")).To(Equal(" 40 a diner toms"))
})
+
+ It("remove opening brackets", func() {
+ Expect(getFullText("[Five Years]")).To(Equal(" five years"))
+ })
})
})