mirror of
https://github.com/AlistGo/alist.git
synced 2025-06-05 18:04:39 +08:00
✨ local sort bring folders to the front
This commit is contained in:
@ -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":
|
||||
{
|
||||
|
Reference in New Issue
Block a user