mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-11 06:30:57 +08:00
This commit is contained in:
parent
1c5eccd510
commit
edd90ce7cf
@ -17,14 +17,16 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/88250/lute/ast"
|
"github.com/88250/gulu"
|
||||||
"github.com/siyuan-note/logging"
|
|
||||||
"github.com/siyuan-note/riff"
|
|
||||||
"github.com/siyuan-note/siyuan/kernel/util"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"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{}
|
var Decks = map[string]*riff.Deck{}
|
||||||
@ -47,6 +49,10 @@ func AddFlashcard(blockID string, deckName string) (err error) {
|
|||||||
|
|
||||||
func InitFlashcards() {
|
func InitFlashcards() {
|
||||||
riffSavePath := filepath.Join(util.DataDir, "storage", "riff")
|
riffSavePath := filepath.Join(util.DataDir, "storage", "riff")
|
||||||
|
if !gulu.File.IsDir(riffSavePath) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
entries, err := os.ReadDir(riffSavePath)
|
entries, err := os.ReadDir(riffSavePath)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
logging.LogErrorf("read riff dir failed: %s", err)
|
logging.LogErrorf("read riff dir failed: %s", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user