Show card NextDue to the flashcard management UI (#9621)

* Show RiffCard NextDue to the UI

* Show RiffCard NextDue to the UI

* Show card NextDue to the flashcard management UI
This commit is contained in:
debbbbie 2023-11-10 20:21:56 +08:00 committed by GitHub
parent 432634beea
commit 48c354e7de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 30 additions and 5 deletions

View file

@ -24,6 +24,7 @@ import (
"github.com/88250/lute/ast"
"github.com/88250/lute/parse"
"github.com/open-spaced-repetition/go-fsrs"
"github.com/siyuan-note/siyuan/kernel/sql"
"github.com/siyuan-note/siyuan/kernel/treenode"
"github.com/siyuan-note/siyuan/kernel/util"
@ -60,8 +61,20 @@ type Block struct {
Created string `json:"created"`
Updated string `json:"updated"`
RiffCardID string `json:"riffCardID"`
RiffCardReps uint64 `json:"riffCardReps"`
RiffCardID string `json:"riffCardID"`
RiffCard *RiffCard `json:"riffCard"`
}
type RiffCard struct {
Due time.Time `json:"due"`
Reps uint64 `json:"reps"`
}
func GetRiffCard(card *fsrs.Card) *RiffCard {
return &RiffCard{
Due: card.Due,
Reps: card.Reps,
}
}
func (block *Block) IsContainerBlock() bool {