From db58dabd319af9867b88fc817b31e8332e12fd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=87=89?= <927625802@qq.com> Date: Sun, 9 Jan 2022 19:28:48 +0800 Subject: [PATCH] :sparkles: local sort bring folders to the front --- model/file.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/model/file.go b/model/file.go index 55a5ab88..c5a8e4b7 100644 --- a/model/file.go +++ b/model/file.go @@ -25,6 +25,14 @@ func SortFiles(files []File, account *Account) { return } sort.Slice(files, func(i, j int) bool { + if files[i].IsDir() || files[j].IsDir() { + if !files[i].IsDir() { + return false + } + if !files[j].IsDir() { + return true + } + } switch account.OrderBy { case "name": {