Skip to content

Commit a92d96d

Browse files
committed
Sort playlists in tabs
1 parent def3c4f commit a92d96d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

menu/scene_tabs.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"os"
66
"os/user"
77
"regexp"
8+
"sort"
89
"strings"
910

1011
"github.com/libretro/ludo/input"
@@ -122,8 +123,15 @@ func refreshTabs() {
122123
func getPlaylists() []entry {
123124
playlists.LoadPlaylists()
124125

126+
// To store the keys in slice in sorted order
127+
var keys []string
128+
for k := range playlists.Playlists {
129+
keys = append(keys, k)
130+
}
131+
sort.Strings(keys)
132+
125133
var pls []entry
126-
for path := range playlists.Playlists {
134+
for _, path := range keys {
127135
path := path
128136
filename := utils.Filename(path)
129137
count := playlistCount(path)

0 commit comments

Comments
 (0)