From ec5cc03b0f10bf19213f2067c7330fc7e00e740a Mon Sep 17 00:00:00 2001 From: sentriz Date: Sat, 11 Jul 2020 18:43:54 +0100 Subject: [PATCH] Sort artists AlbumsListWithSongs albums by year --- sublime/ui/artists.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sublime/ui/artists.py b/sublime/ui/artists.py index cd2a789..97bdf85 100644 --- a/sublime/ui/artists.py +++ b/sublime/ui/artists.py @@ -613,7 +613,9 @@ class AlbumsListWithSongs(Gtk.Overlay): self.spinner.hide() return - new_albums = sorted(artist.albums or [], key=lambda a: a.name) + new_albums = sorted( + artist.albums or [], key=lambda a: (a.year or float("inf"), a.name) + ) if self.albums == new_albums: # Just go through all of the colidren and update them.