From 865848c7bc1c6c4ad296b971ed8f815995d02b6d Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 8 Oct 2020 13:32:50 +0200 Subject: [PATCH] Sort files in web interface. --- webserver/webserver.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webserver/webserver.go b/webserver/webserver.go index aa552bb..349755b 100644 --- a/webserver/webserver.go +++ b/webserver/webserver.go @@ -14,6 +14,7 @@ import ( "os" "path" "path/filepath" + "sort" "strings" "sync/atomic" "time" @@ -551,6 +552,10 @@ func serveGroupRecordings(w http.ResponseWriter, r *http.Request, f *os.File, gr return } + sort.Slice(fis, func(i, j int) bool { + return fis[i].Name() < fis[j].Name() + }) + w.Header().Set("content-type", "text/html; charset=utf-8") w.Header().Set("cache-control", "no-cache")