🐛 Notebook data may be corrupted during data synchronization https://github.com/siyuan-note/siyuan/issues/9594

This commit is contained in:
Daniel 2023-11-06 22:13:04 +08:00
parent a721bbe6f0
commit 70c56c8e25
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
24 changed files with 88 additions and 96 deletions

View file

@ -18,10 +18,10 @@ package sql
import (
"database/sql"
"github.com/siyuan-note/filelock"
"path/filepath"
"strings"
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/treenode"
@ -139,17 +139,17 @@ func scanAssetRows(rows *sql.Rows) (ret *Asset) {
func assetLocalPath(linkDest, boxLocalPath, docDirLocalPath string) (ret string) {
ret = filepath.Join(docDirLocalPath, linkDest)
if gulu.File.IsExist(ret) {
if filelock.IsExist(ret) {
return
}
ret = filepath.Join(boxLocalPath, linkDest)
if gulu.File.IsExist(ret) {
if filelock.IsExist(ret) {
return
}
ret = filepath.Join(util.DataDir, linkDest)
if gulu.File.IsExist(ret) {
if filelock.IsExist(ret) {
return
}
return ""