diff --git a/sublime_music/ui/browse.py b/sublime_music/ui/browse.py index 21d2fe1..f42c660 100644 --- a/sublime_music/ui/browse.py +++ b/sublime_music/ui/browse.py @@ -377,6 +377,14 @@ class MusicDirectoryList(Gtk.Box): self.drilldown_directories_store, new_directories_store ) + def song_sort_key(song: API.Song) -> Tuple[Optional[int], Optional[int]]: + return ( + song.disc_number if hasattr(song, "disc_number") else 0, + song.track if hasattr(song, "track") else 0, + ) + + songs.sort(key=song_sort_key) + new_songs_store = [ [ (