mirror of https://github.com/Xhofe/alist
✨ local sort bring folders to the front
parent
7ef98c05fa
commit
db58dabd31
|
@ -25,6 +25,14 @@ func SortFiles(files []File, account *Account) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sort.Slice(files, func(i, j int) bool {
|
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 {
|
switch account.OrderBy {
|
||||||
case "name":
|
case "name":
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue