use consistent case for indexes

This commit is contained in:
sentriz
2019-06-07 11:23:09 +01:00
parent 8123be035c
commit c6fdd38f4e
5 changed files with 15 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ import (
"net/http"
"os"
"path"
"strings"
"sync/atomic"
"time"
"unicode"
@@ -18,13 +19,13 @@ import (
"github.com/sentriz/gonic/server/subsonic"
)
func indexOf(s string) rune {
first := string(s[0])
c := rune(unidecode.Unidecode(first)[0])
if !unicode.IsLetter(c) {
return '#'
func indexOf(in byte) string {
lower := strings.ToLower(string(in))
decode := unidecode.Unidecode(lower)
if !unicode.IsLetter(rune(decode[0])) {
return "#"
}
return c
return decode
}
func (c *Controller) Stream(w http.ResponseWriter, r *http.Request) {