From c2188b8c19b336395b94377bd4dde96780a0a01c Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 31 Oct 2022 00:04:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:art:=20`=E7=BD=91=E7=BB=9C=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E8=BD=AC=E6=8D=A2=E4=B8=BA=E6=9C=AC=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E7=89=87`=20=E9=81=B5=E5=BE=AA=E7=AC=94=E8=AE=B0=E6=9C=AC?= =?UTF-8?q?=E7=BA=A7=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=20Fix=20https://github.com/siyuan-note/siyuan/issues/6407?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/assets.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel/model/assets.go b/kernel/model/assets.go index 2246ee79d..bab1b89e7 100644 --- a/kernel/model/assets.go +++ b/kernel/model/assets.go @@ -76,6 +76,15 @@ func NetImg2LocalAssets(rootID string) (err error) { var files int msgId := gulu.Rand.String(7) + + docDirLocalPath := filepath.Join(util.DataDir, tree.Box, path.Dir(tree.Path)) + assetsDirPath := getAssetsDir(filepath.Join(util.DataDir, tree.Box), docDirLocalPath) + if !gulu.File.IsExist(assetsDirPath) { + if err = os.MkdirAll(assetsDirPath, 0755); nil != err { + return + } + } + ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus { if !entering { return ast.WalkContinue @@ -140,7 +149,7 @@ func NetImg2LocalAssets(rootID string) (err error) { name = gulu.Str.SubStr(name, 64) name = util.FilterFileName(name) name = "net-img-" + name + "-" + ast.NewNodeID() + ext - writePath := filepath.Join(util.DataDir, "assets", name) + writePath := filepath.Join(assetsDirPath, name) if err = filelock.WriteFile(writePath, data); nil != err { logging.LogErrorf("write downloaded net img [%s] to local assets [%s] failed: %s", u, writePath, err) return ast.WalkSkipChildren From 048828e7d2e8dd432833d3c7d3de8777e83ae404 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 31 Oct 2022 00:17:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:memo:=20=E5=90=AC=E8=AF=B4=E6=80=9D?= =?UTF-8?q?=E6=BA=90=E7=AC=94=E8=AE=B0=E4=BC=9A=E9=80=9A=E8=BF=87=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=94=B5=E8=84=91=E6=8C=96=E7=9F=BF=20Fix=20https://g?= =?UTF-8?q?ithub.com/siyuan-note/siyuan/issues/6416?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_zh_CN.md | 4 ++ .../20200813093015-u6bopdt.sy | 41 ++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/README_zh_CN.md b/README_zh_CN.md index e6f45cd3e..84a11b898 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -162,6 +162,10 @@ ## ❓ 常见问题和解答 +### 听说思源笔记会通过用户电脑挖矿? + +详情请看[如何评价思源笔记? - 知乎](https://www.zhihu.com/question/434530733/answer/2644563326)。 + ### 思源适合我吗?或者说我应该如何选择笔记软件? 这个问题因人而异,很难统一回答。如果你不太确定思源是否适合你,请看如下建议: diff --git a/app/guide/20210808180117-czj9bvb/20200813093015-u6bopdt.sy b/app/guide/20210808180117-czj9bvb/20200813093015-u6bopdt.sy index dbebbb2f0..256665d35 100644 --- a/app/guide/20210808180117-czj9bvb/20200813093015-u6bopdt.sy +++ b/app/guide/20210808180117-czj9bvb/20200813093015-u6bopdt.sy @@ -7,9 +7,48 @@ "id": "20200813093015-u6bopdt", "title": "常见问题", "type": "doc", - "updated": "20220909100829" + "updated": "20221031001420" }, "Children": [ + { + "ID": "20221031001313-rk7sd0e", + "Type": "NodeHeading", + "HeadingLevel": 2, + "Properties": { + "id": "20221031001313-rk7sd0e", + "updated": "20221031001313" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "听说思源笔记会通过用户电脑挖矿?" + } + ] + }, + { + "ID": "20221031001314-v5a3pa8", + "Type": "NodeParagraph", + "Properties": { + "id": "20221031001314-v5a3pa8", + "updated": "20221031001420" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "详情请看" + }, + { + "Type": "NodeTextMark", + "TextMarkType": "a", + "TextMarkAHref": "https://www.zhihu.com/question/434530733/answer/2644563326", + "TextMarkTextContent": "如何评价思源笔记? - 知乎" + }, + { + "Type": "NodeText", + "Data": "。" + } + ] + }, { "ID": "20220617160928-fw4ixa3", "Type": "NodeHeading",