Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: API `getTag` add an optional parameter `ignoreMaxListHint` https://github.com/siyuan-note/siyuan/issues/16000

Daniele9411f9677dd
diff --git a/kernel/api/tag.go b/kernel/api/tag.go
index e844aed292..da2ebf701a 100644
--- a/kernel/api/tag.go
+++ b/kernel/api/tag.go
@@ -43,7 +43,14 @@ func getTag(c *gin.Context) {
model.Conf.Tag.Sort = sortMode
model.Conf.Save()
- ret.Data = model.BuildTags()
+ // API `getTag` add an optional parameter `ignoreMaxListHint` https://github.com/siyuan-note/siyuan/issues/16000
+ ignoreMaxListHint := false
+ ignoreMaxListHintArg := arg["ignoreMaxListHint"]
+ if nil != ignoreMaxListHintArg {
+ ignoreMaxListHint = ignoreMaxListHintArg.(bool)
+ }
+
+ ret.Data = model.BuildTags(ignoreMaxListHint)
}
func renameTag(c *gin.Context) {
diff --git a/kernel/model/tag.go b/kernel/model/tag.go
index d0d652ce6e..a44d7c0f08 100644
--- a/kernel/model/tag.go
+++ b/kernel/model/tag.go
@@ -236,7 +236,7 @@ type Tag struct {
type Tags []*Tag
-func BuildTags() (ret *Tags) {
+func BuildTags(ignoreMaxListHintArg bool) (ret *Tags) {
FlushTxQueue()
sql.FlushQueue()
@@ -254,7 +254,7 @@ func BuildTags() (ret *Tags) {
for _, tag := range tags {
*tmp = append(*tmp, tag)
countTag(tag, &total)
- if Conf.FileTree.MaxListCount < total {
+ if Conf.FileTree.MaxListCount < total && !ignoreMaxListHintArg {
util.PushMsg(fmt.Sprintf(Conf.Language(243), Conf.FileTree.MaxListCount), 7000)
break
}