🎨 Subdocuments created by the database are not displayed in the doc tree https://github.com/siyuan-note/siyuan/issues/9091

This commit is contained in:
Daniel 2023-09-05 16:42:15 +08:00
parent d6fa43c153
commit 682415ae80
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 21 additions and 8 deletions

View file

@ -66,6 +66,7 @@ type File struct {
HCtime string `json:"hCtime"`
Sort int `json:"sort"`
SubFileCount int `json:"subFileCount"`
Hidden bool `json:"hidden"`
NewFlashcardCount int `json:"newFlashcardCount"`
DueFlashcardCount int `json:"dueFlashcardCount"`
@ -231,7 +232,7 @@ type FileInfo struct {
isdir bool
}
func ListDocTree(boxID, path string, sortMode int, flashcard bool, maxListCount int) (ret []*File, totals int, err error) {
func ListDocTree(boxID, path string, sortMode int, flashcard, showHidden bool, maxListCount int) (ret []*File, totals int, err error) {
//os.MkdirAll("pprof", 0755)
//cpuProfile, _ := os.Create("pprof/cpu_profile_list_doc_tree")
//pprof.StartCPUProfile(cpuProfile)
@ -290,6 +291,10 @@ func ListDocTree(boxID, path string, sortMode int, flashcard bool, maxListCount
continue
}
if ial := box.docIAL(parentDocPath); nil != ial {
if !showHidden && "true" == ial["custom-hidden"] {
continue
}
doc := box.docFromFileInfo(parentDocFile, ial)
subFiles, err := os.ReadDir(filepath.Join(boxLocalPath, file.path))
if nil == err {
@ -323,6 +328,10 @@ func ListDocTree(boxID, path string, sortMode int, flashcard bool, maxListCount
}
if ial := box.docIAL(file.path); nil != ial {
if !showHidden && "true" == ial["custom-hidden"] {
continue
}
doc := box.docFromFileInfo(file, ial)
if flashcard {