An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: 支持浏览卡包内的闪卡 https://github.com/siyuan-note/siyuan/issues/6943
Liang Dingb999d293d5ff
diff --git a/kernel/model/flashcard.go b/kernel/model/flashcard.goindex c292b9b0d2..8051c8c17c 100644--- a/kernel/model/flashcard.go+++ b/kernel/model/flashcard.go@@ -18,6 +18,7 @@ package modelimport ("errors"+ "math""os""path/filepath""sort"@@ -45,14 +46,15 @@ func GetFlashcards(deckID string, page int) (blockIDs []string, total, pageCountreturn}+ const pageSize = 20var allBlockIDs []stringfor bID, _ := range deck.BlockCard {allBlockIDs = append(allBlockIDs, bID)}sort.Strings(allBlockIDs)- start := (page - 1) * 20- end := page * 20+ start := (page - 1) * pageSize+ end := page * pageSizeif start > len(allBlockIDs) {return}@@ -61,7 +63,7 @@ func GetFlashcards(deckID string, page int) (blockIDs []string, total, pageCount}blockIDs = allBlockIDs[start:end]total = len(allBlockIDs)- pageCount = total / 20+ pageCount = int(math.Ceil(float64(total) / float64(pageSize)))return}