Skip to content

Commit

Permalink
🎨 Apply result optimized by FSRS optimizer #9309
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Sep 28, 2023
1 parent 6354d04 commit 172b7ed
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions kernel/conf/flashcard.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Flashcard struct {

// Apply result optimized by FSRS optimizer https://github.com/siyuan-note/siyuan/issues/9309
RequestRetention float64 `json:"requestRetention"`
MaximumInterval float64 `json:"maximumInterval"`
MaximumInterval int `json:"maximumInterval"`
Weights string `json:"weights"`
}

Expand All @@ -54,7 +54,7 @@ func NewFlashcard() *Flashcard {
SuperBlock: true,
Deck: false,
RequestRetention: param.RequestRetention,
MaximumInterval: param.MaximumInterval,
MaximumInterval: int(param.MaximumInterval),
Weights: weightsBuilder.String(),
}
}
2 changes: 1 addition & 1 deletion kernel/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ require (
github.com/siyuan-note/filelock v0.0.0-20230615140405-d05a21d49524
github.com/siyuan-note/httpclient v0.0.0-20230922010609-a6133879be6b
github.com/siyuan-note/logging v0.0.0-20230327073243-ebe83aec1493
github.com/siyuan-note/riff v0.0.0-20230728105206-f7c344346d61
github.com/siyuan-note/riff v0.0.0-20230928143458-ffd178c7e0fc
github.com/steambap/captcha v1.4.1
github.com/studio-b12/gowebdav v0.9.0
github.com/vmihailenco/msgpack/v5 v5.3.5
Expand Down
6 changes: 2 additions & 4 deletions kernel/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20230615033005-b519d6875346 h1:U0wZN6zuf+vUhzdHC6DbZE/bY5FUt3FuCwn/KgObV44=
github.com/88250/gulu v1.2.3-0.20230615033005-b519d6875346/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k=
github.com/88250/lute v1.7.6-0.20230925134424-c4f269de7172 h1:wZagZwg4ez/uaabhjCVuHajOPB5R789NfAMOE4HCjcE=
github.com/88250/lute v1.7.6-0.20230925134424-c4f269de7172/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/lute v1.7.6-0.20230926080700-f85353a11d9f h1:3AJ6U8ueNpb9J+dODXFgleNZR0QwnNg1h4u5/J/jvzo=
github.com/88250/lute v1.7.6-0.20230926080700-f85353a11d9f/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0=
Expand Down Expand Up @@ -531,8 +529,8 @@ github.com/siyuan-note/httpclient v0.0.0-20230922010609-a6133879be6b h1:a1XJzchC
github.com/siyuan-note/httpclient v0.0.0-20230922010609-a6133879be6b/go.mod h1:1Sx/ReaOC4VHKVzwzrLw1ijc9OhXElPQcv4uOrf60jk=
github.com/siyuan-note/logging v0.0.0-20230327073243-ebe83aec1493 h1:oaN5b0WDFkjdBgGxmmBnMrtZxaJ76LZLwhQSZnznJMI=
github.com/siyuan-note/logging v0.0.0-20230327073243-ebe83aec1493/go.mod h1:6mRFtAAvYPn3cDzqvyv+t8BVPGqpONDMMb5ywOhY1D4=
github.com/siyuan-note/riff v0.0.0-20230728105206-f7c344346d61 h1:67G1+JSlkcbRsCig83khfK7e96DxrsVnha87Tm/xgdo=
github.com/siyuan-note/riff v0.0.0-20230728105206-f7c344346d61/go.mod h1:ofTZZkYTjMS/mYo9VLjQfgsiwlTEK4ragBiQmKSK/QE=
github.com/siyuan-note/riff v0.0.0-20230928143458-ffd178c7e0fc h1:EDbkzdLfR+gMYyU4h/xUiwxngz75d3L5M0IN0NTqdVU=
github.com/siyuan-note/riff v0.0.0-20230928143458-ffd178c7e0fc/go.mod h1:WxG165xAPeGok0Q/15KMhnNbesoU5ZG+/zikTyWzZi8=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.7 h1:I6tZjLXD2Q1kjvNbIzB1wvQBsXmKXiVrhpRE8ZjP5jY=
Expand Down
4 changes: 2 additions & 2 deletions kernel/model/flashcard.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ func LoadFlashcards() {
name := entry.Name()
if strings.HasSuffix(name, ".deck") {
deckID := strings.TrimSuffix(name, ".deck")
deck, loadErr := riff.LoadDeck(riffSavePath, deckID)
deck, loadErr := riff.LoadDeck(riffSavePath, deckID, Conf.Flashcard.RequestRetention, Conf.Flashcard.MaximumInterval, Conf.Flashcard.Weights)
if nil != loadErr {
logging.LogErrorf("load deck [%s] failed: %s", name, loadErr)
continue
Expand Down Expand Up @@ -794,7 +794,7 @@ func createDeck(name string) (deck *riff.Deck, err error) {

func createDeck0(name string, deckID string) (deck *riff.Deck, err error) {
riffSavePath := getRiffDir()
deck, err = riff.LoadDeck(riffSavePath, deckID)
deck, err = riff.LoadDeck(riffSavePath, deckID, Conf.Flashcard.RequestRetention, Conf.Flashcard.MaximumInterval, Conf.Flashcard.Weights)
if nil != err {
logging.LogErrorf("load deck [%s] failed: %s", deckID, err)
return
Expand Down

0 comments on commit 172b7ed

Please sign in to comment.