mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 16:24:20 +01:00
Improve API listDocsByPath param sort (#8156)
* `listDocsByPath` API `sort` param backend * `listDocsByPath` API `sort` param frontend * `listDocsByPath` API `sort` param
This commit is contained in:
parent
cb527d7765
commit
6b62a69299
8 changed files with 21 additions and 22 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"github.com/88250/lute/parse"
|
||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func mergeSubDocs(rootTree *parse.Tree) (ret *parse.Tree, err error) {
|
||||
|
|
@ -110,7 +111,7 @@ func loadTreeNodes(box string, p string, level int) (ret []*ast.Node, err error)
|
|||
}
|
||||
|
||||
func buildBlockChildren(block *Block) (err error) {
|
||||
files, _, err := ListDocTree(block.Box, block.Path, Conf.FileTree.Sort, false, Conf.FileTree.MaxListCount)
|
||||
files, _, err := ListDocTree(block.Box, block.Path, util.SortModeUnassigned, false, Conf.FileTree.MaxListCount)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -244,8 +244,12 @@ func ListDocTree(boxID, path string, sortMode int, flashcard bool, maxListCount
|
|||
}
|
||||
|
||||
boxConf := box.GetConf()
|
||||
if util.SortModeFileTree != boxConf.SortMode {
|
||||
sortMode = boxConf.SortMode
|
||||
|
||||
if util.SortModeUnassigned == sortMode {
|
||||
sortMode = Conf.FileTree.Sort
|
||||
if util.SortModeFileTree != boxConf.SortMode {
|
||||
sortMode = boxConf.SortMode
|
||||
}
|
||||
}
|
||||
|
||||
var files []*FileInfo
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ func Mount(boxID string) (alreadyMount bool, err error) {
|
|||
|
||||
box.Index()
|
||||
// 缓存根一级的文档树展开
|
||||
ListDocTree(box.ID, "/", Conf.FileTree.Sort, false, Conf.FileTree.MaxListCount)
|
||||
ListDocTree(box.ID, "/", util.SortModeUnassigned, false, Conf.FileTree.MaxListCount)
|
||||
treenode.SaveBlockTree(false)
|
||||
util.ClearPushProgress(100)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue