From f1918ea37fbaaf85427dd5732694b4dbf44567d6 Mon Sep 17 00:00:00 2001 From: genteure Date: Sat, 17 Jun 2023 18:26:57 +0800 Subject: [PATCH] fix(web): sort by file name in file browser fix #473 --- BililiveRecorder.Web/BililiveRecorderDirectoryFormatter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BililiveRecorder.Web/BililiveRecorderDirectoryFormatter.cs b/BililiveRecorder.Web/BililiveRecorderDirectoryFormatter.cs index 77720ab..870eaee 100644 --- a/BililiveRecorder.Web/BililiveRecorderDirectoryFormatter.cs +++ b/BililiveRecorder.Web/BililiveRecorderDirectoryFormatter.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using System.Threading.Tasks; using Fluid; @@ -35,7 +36,7 @@ namespace BililiveRecorder.Web var tc = new TemplateContext(options); tc.SetValue("path", (context.Request.PathBase + context.Request.Path).Value); - tc.SetValue("files", contents); + tc.SetValue("files", contents.OrderBy(x => x.Name)); var result = template.Render(tc);