use unidecoded string when searching

This commit is contained in:
sentriz
2019-06-27 15:36:10 +01:00
parent 45c2336731
commit dea0a5cfab
5 changed files with 25 additions and 13 deletions

View File

@@ -11,7 +11,6 @@ import (
"unicode"
"github.com/jinzhu/gorm"
"github.com/rainycape/unidecode"
"github.com/sentriz/gonic/model"
"github.com/sentriz/gonic/scanner"
@@ -21,11 +20,10 @@ import (
func indexOf(in byte) string {
lower := strings.ToLower(string(in))
decode := unidecode.Unidecode(lower)
if !unicode.IsLetter(rune(decode[0])) {
if !unicode.IsLetter(rune(lower[0])) {
return "#"
}
return decode
return lower
}
func (c *Controller) Stream(w http.ResponseWriter, r *http.Request) {