This commit is contained in:
Liang Ding 2022-12-21 14:46:27 +08:00
parent 1c5eccd510
commit edd90ce7cf
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D

View File

@ -17,14 +17,16 @@
package model
import (
"github.com/88250/lute/ast"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/riff"
"github.com/siyuan-note/siyuan/kernel/util"
"github.com/88250/gulu"
"os"
"path/filepath"
"strings"
"sync"
"github.com/88250/lute/ast"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/riff"
"github.com/siyuan-note/siyuan/kernel/util"
)
var Decks = map[string]*riff.Deck{}
@ -47,6 +49,10 @@ func AddFlashcard(blockID string, deckName string) (err error) {
func InitFlashcards() {
riffSavePath := filepath.Join(util.DataDir, "storage", "riff")
if !gulu.File.IsDir(riffSavePath) {
return
}
entries, err := os.ReadDir(riffSavePath)
if nil != err {
logging.LogErrorf("read riff dir failed: %s", err)