From 45c5d1770ae38be2fe4a9a02a281d8ef81b6c31b Mon Sep 17 00:00:00 2001 From: Nodude <75137537+NodudeWasTaken@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:59:45 +0200 Subject: [PATCH] Sort filter names --- internal/heresphere/routes.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/heresphere/routes.go b/internal/heresphere/routes.go index 1481269f095..874bca43728 100644 --- a/internal/heresphere/routes.go +++ b/internal/heresphere/routes.go @@ -8,6 +8,7 @@ import ( "fmt" "io" "net/http" + "sort" "strconv" "strings" @@ -193,7 +194,15 @@ func (rs Routes) heresphereIndex(w http.ResponseWriter, r *http.Request) { // Add filters parsedFilters, err := getAllFilters(r.Context(), rs.Repository) if err == nil { - for key, value := range parsedFilters { + var keys []string + for key := range parsedFilters { + keys = append(keys, key) + } + + sort.Strings(keys) + + for _, key := range keys { + value := parsedFilters[key] sceneUrls := make([]string, len(value)) for idx, sceneID := range value {