This commit is contained in:
Liang Ding 2022-12-21 14:51:30 +08:00
parent 8593247172
commit 6fa661982d
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D

View File

@ -48,7 +48,7 @@ func AddFlashcard(blockID string, deckName string) (err error) {
}
func InitFlashcards() {
riffSavePath := filepath.Join(util.DataDir, "storage", "riff")
riffSavePath := getRiffDir()
if !gulu.File.IsDir(riffSavePath) {
return
}
@ -78,7 +78,7 @@ func InitFlashcards() {
}
func CreateDeck(name string) (err error) {
riffSavePath := filepath.Join(util.DataDir, "storage", "riff")
riffSavePath := getRiffDir()
deck, err := riff.LoadDeck(riffSavePath, name, riff.AlgoFSRS)
if nil != err {
logging.LogErrorf("load deck [%s] failed: %s", name, err)
@ -103,3 +103,7 @@ func SaveDeck(name string) (err error) {
}
return
}
func getRiffDir() string {
return filepath.Join(util.DataDir, "storage", "riff")
}