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

@@ -23,14 +23,14 @@ func (c *Controller) GetIndexes(w http.ResponseWriter, r *http.Request) {
c.DB.
Where("parent_id = 1").
Find(&folders)
indexMap := make(map[rune]*subsonic.Index)
indexMap := make(map[string]*subsonic.Index)
indexes := []*subsonic.Index{}
for _, folder := range folders {
i := indexOf(folder.RightPath)
i := indexOf(folder.RightPath[0])
index, ok := indexMap[i]
if !ok {
index = &subsonic.Index{
Name: string(i),
Name: i,
Artists: []*subsonic.Artist{},
}
indexMap[i] = index