From 31e1966ffa38753e585cc0dd03eda457c9697b3a Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 14 Apr 2023 12:02:55 +0800 Subject: [PATCH] :art: API `listDocsByPath` add an optional parameter `maxListCount` Fix https://github.com/siyuan-note/siyuan/issues/7993 --- kernel/api/filetree.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/api/filetree.go b/kernel/api/filetree.go index f1018838c..4ecc3163f 100644 --- a/kernel/api/filetree.go +++ b/kernel/api/filetree.go @@ -18,6 +18,7 @@ package api import ( "fmt" + "math" "net/http" "path" "regexp" @@ -621,7 +622,11 @@ func listDocsByPath(c *gin.Context) { } maxListCount := model.Conf.FileTree.MaxListCount if arg["maxListCount"] != nil { + // API `listDocsByPath` add an optional parameter `maxListCount` https://github.com/siyuan-note/siyuan/issues/7993 maxListCount = int(arg["maxListCount"].(float64)) + if 0 == maxListCount { + maxListCount = math.MaxInt + } } files, totals, err := model.ListDocTree(notebook, p, sortMode, flashcard, maxListCount)