diff --git a/kernel/conf/flashcard.go b/kernel/conf/flashcard.go index e0d9416f03e..6977ab9f17c 100644 --- a/kernel/conf/flashcard.go +++ b/kernel/conf/flashcard.go @@ -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"` } @@ -54,7 +54,7 @@ func NewFlashcard() *Flashcard { SuperBlock: true, Deck: false, RequestRetention: param.RequestRetention, - MaximumInterval: param.MaximumInterval, + MaximumInterval: int(param.MaximumInterval), Weights: weightsBuilder.String(), } } diff --git a/kernel/go.mod b/kernel/go.mod index 42ad10ac0bb..1e048ea03ee 100644 --- a/kernel/go.mod +++ b/kernel/go.mod @@ -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 diff --git a/kernel/go.sum b/kernel/go.sum index 1295df5757a..f74ea643d7c 100644 --- a/kernel/go.sum +++ b/kernel/go.sum @@ -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= @@ -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= diff --git a/kernel/model/flashcard.go b/kernel/model/flashcard.go index 999be7c4403..600b11d7763 100644 --- a/kernel/model/flashcard.go +++ b/kernel/model/flashcard.go @@ -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 @@ -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