fix(web): sort by file name in file browser

fix #473
This commit is contained in:
genteure 2023-06-17 18:26:57 +08:00
parent a4bc0a1742
commit f1918ea37f

View File

@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Fluid; using Fluid;
@ -35,7 +36,7 @@ namespace BililiveRecorder.Web
var tc = new TemplateContext(options); var tc = new TemplateContext(options);
tc.SetValue("path", (context.Request.PathBase + context.Request.Path).Value); 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); var result = template.Render(tc);