Pārlūkot izejas kodu

:art: Distinguish between new cards and review cards during spaced repetition https://github.com/siyuan-note/siyuan/issues/9377

Daniel 1 gadu atpakaļ
vecāks
revīzija
4dfa072278
1 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 5 5
      kernel/model/flashcard.go

+ 5 - 5
kernel/model/flashcard.go

@@ -29,7 +29,6 @@ import (
 	"github.com/88250/gulu"
 	"github.com/88250/gulu"
 	"github.com/88250/lute/ast"
 	"github.com/88250/lute/ast"
 	"github.com/88250/lute/parse"
 	"github.com/88250/lute/parse"
-	"github.com/open-spaced-repetition/go-fsrs"
 	"github.com/siyuan-note/filelock"
 	"github.com/siyuan-note/filelock"
 	"github.com/siyuan-note/logging"
 	"github.com/siyuan-note/logging"
 	"github.com/siyuan-note/riff"
 	"github.com/siyuan-note/riff"
@@ -1020,17 +1019,18 @@ func getDeckDueCards(deck *riff.Deck, reviewedCardIDs, blockIDs []string, newCar
 			continue
 			continue
 		}
 		}
 
 
-		fsrsCard := c.Impl().(*fsrs.Card)
-		if fsrs.New == fsrsCard.State {
-			newCount++
+		if riff.New == c.GetState() {
 			if newCount > newCardLimit {
 			if newCount > newCardLimit {
 				continue
 				continue
 			}
 			}
+
+			newCount++
 		} else {
 		} else {
-			reviewCount++
 			if reviewCount > reviewCardLimit {
 			if reviewCount > reviewCardLimit {
 				continue
 				continue
 			}
 			}
+
+			reviewCount++
 		}
 		}
 
 
 		if 0 < len(reviewedCardIDs) {
 		if 0 < len(reviewedCardIDs) {