From 39ca6bce24a0a7779a7e1c7506d9c492a7f21fcb Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Wed, 28 Aug 2024 18:06:08 +0800 Subject: [PATCH] :arrow_up: update to FSRS-5 & go-fsrs@v2.0.1 (#10) --- deck_test.go | 2 +- fsrs_store.go | 4 ++-- fsrs_store_test.go | 5 +++-- go.mod | 2 +- go.sum | 2 ++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/deck_test.go b/deck_test.go index acffcf5..3da734a 100644 --- a/deck_test.go +++ b/deck_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - "github.com/open-spaced-repetition/go-fsrs" + "github.com/open-spaced-repetition/go-fsrs/v2" ) func TestDeck(t *testing.T) { diff --git a/fsrs_store.go b/fsrs_store.go index 9a588e4..53cdc29 100644 --- a/fsrs_store.go +++ b/fsrs_store.go @@ -25,7 +25,7 @@ import ( "time" "github.com/88250/gulu" - "github.com/open-spaced-repetition/go-fsrs" + "github.com/open-spaced-repetition/go-fsrs/v2" "github.com/siyuan-note/filelock" "github.com/siyuan-note/logging" "github.com/vmihailenco/msgpack/v5" @@ -42,7 +42,7 @@ func NewFSRSStore(id, saveDir string, requestRetention float64, maximumInterval params := fsrs.DefaultParam() params.RequestRetention = requestRetention params.MaximumInterval = float64(maximumInterval) - params.W = [17]float64{} + params.W = [19]float64{0} for i, w := range strings.Split(weights, ",") { w = strings.TrimSpace(w) params.W[i], _ = strconv.ParseFloat(w, 64) diff --git a/fsrs_store_test.go b/fsrs_store_test.go index 6edb3ae..d2783f0 100644 --- a/fsrs_store_test.go +++ b/fsrs_store_test.go @@ -17,13 +17,14 @@ package riff import ( - "github.com/88250/gulu" "os" "strings" "testing" "time" - "github.com/open-spaced-repetition/go-fsrs" + "github.com/88250/gulu" + + "github.com/open-spaced-repetition/go-fsrs/v2" ) const ( diff --git a/go.mod b/go.mod index b0331b6..56a8ca7 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.21.6 require ( github.com/88250/gulu v1.2.3-0.20231209020950-b7b6994e395c - github.com/open-spaced-repetition/go-fsrs v1.2.1 + github.com/open-spaced-repetition/go-fsrs/v2 v2.0.1 github.com/siyuan-note/filelock v0.0.0-20240419132904-2fbfe64f1939 github.com/siyuan-note/logging v0.0.0-20231208035918-61f884c854f0 github.com/vmihailenco/msgpack/v5 v5.4.1 diff --git a/go.sum b/go.sum index b728182..271b8f4 100644 --- a/go.sum +++ b/go.sum @@ -33,6 +33,8 @@ github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE= github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= github.com/open-spaced-repetition/go-fsrs v1.2.1 h1:vY1hSQ3gvHtfnw8ahylcZyyqusKWDkWCd1+ca4lZoSc= github.com/open-spaced-repetition/go-fsrs v1.2.1/go.mod h1:WpbNs4TTKZChOHFO+ME0B9femUVZsepFT5mhAioszRg= +github.com/open-spaced-repetition/go-fsrs/v2 v2.0.1 h1:ODpQGZqZNsKqAF4/WUdRtfuNtwDIfI6Xj3cSznxk0g0= +github.com/open-spaced-repetition/go-fsrs/v2 v2.0.1/go.mod h1:Ry+MLx079nUXwSbYm+OYLK9pQ9yu0cCLWSo3N4H5ZBI= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=