clean up indexings

This commit is contained in:
sentriz
2019-06-27 18:06:33 +01:00
parent c6d4ea5b90
commit 79eeca77ae
6 changed files with 28 additions and 15 deletions

View File

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