Return artist indexes in lexigraphical order.

This commit is contained in:
EdwardDowling
2019-06-01 15:59:42 +01:00
parent e60da75422
commit c6ca1a1475
3 changed files with 7 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package handler
import (
"fmt"
"net/http"
"sort"
"strings"
"github.com/jinzhu/gorm"
@@ -30,6 +31,9 @@ func (c *Controller) GetArtists(w http.ResponseWriter, r *http.Request) {
index.Artists = append(index.Artists,
makeArtistFromArtist(&artist))
}
sort.Slice(indexes.List[:], func(i, j int) bool {
return indexes.List[i].Name < indexes.List[j].Name
})
sub := subsonic.NewResponse()
sub.Artists = &indexes
respond(w, r, sub)