Skip to content

Commit

Permalink
Fix #415: sort artist discography by year ascending (same order as Na…
Browse files Browse the repository at this point in the history
…vidrome)
  • Loading branch information
dweymouth committed Jul 10, 2024
1 parent d4f14c4 commit 86c944f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/browsing/artistpage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package browsing

import (
"log"
"sort"
"strconv"

"github.com/dweymouth/supersonic/backend"
Expand Down Expand Up @@ -192,6 +193,9 @@ func (a *ArtistPage) showAlbumGrid() {
a.activeView = 0 // if page still loading, will show discography view first
return
}
sort.Slice(a.artistInfo.Albums, func(x, y int) bool {
return a.artistInfo.Albums[x].Year < a.artistInfo.Albums[y].Year
})
model := sharedutil.MapSlice(a.artistInfo.Albums, func(al *mediaprovider.Album) widgets.GridViewItemModel {
return widgets.GridViewItemModel{
Name: al.Name,
Expand Down

0 comments on commit 86c944f

Please sign in to comment.