sort getMusicDirectory dir children by name

closes #61
This commit is contained in:
sentriz
2020-04-25 19:19:10 +01:00
parent 92573de436
commit 82fa77808f

View File

@@ -65,6 +65,7 @@ func (c *Controller) ServeGetMusicDirectory(r *http.Request) *spec.Response {
var childFolders []*db.Album var childFolders []*db.Album
c.DB. c.DB.
Where("parent_id=?", id). Where("parent_id=?", id).
Order("albums.right_path COLLATE NOCASE").
Find(&childFolders) Find(&childFolders)
for _, c := range childFolders { for _, c := range childFolders {
childrenObj = append(childrenObj, spec.NewTCAlbumByFolder(c)) childrenObj = append(childrenObj, spec.NewTCAlbumByFolder(c))