mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 08:48:49 +01:00
This commit is contained in:
parent
dd912512ab
commit
d28c7d212a
1 changed files with 14 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ import (
|
|||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/88250/lute/parse"
|
||||
"github.com/open-spaced-repetition/go-fsrs"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/riff"
|
||||
"github.com/siyuan-note/siyuan/kernel/cache"
|
||||
|
|
@ -634,6 +635,10 @@ func removeFlashcardsByBlockIDs(blockIDs []string, deck *riff.Deck) {
|
|||
}
|
||||
|
||||
cards := deck.GetCardsByBlockIDs(blockIDs)
|
||||
if 1 > len(cards) {
|
||||
return
|
||||
}
|
||||
|
||||
for _, card := range cards {
|
||||
deck.RemoveCard(card.ID())
|
||||
}
|
||||
|
|
@ -900,11 +905,20 @@ func getDeckDueCards(deck *riff.Deck) (ret []riff.Card) {
|
|||
ret = []riff.Card{}
|
||||
dues := deck.Dues()
|
||||
|
||||
newCount := 0
|
||||
reviewCount := 0
|
||||
for _, c := range dues {
|
||||
if nil != skipCardCache[c.ID()] {
|
||||
continue
|
||||
}
|
||||
|
||||
fsrsCard := c.Impl().(*fsrs.Card)
|
||||
if fsrs.New == fsrsCard.State {
|
||||
newCount++
|
||||
} else {
|
||||
reviewCount++
|
||||
}
|
||||
|
||||
ret = append(ret, c)
|
||||
}
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue