Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-10-10 12:53:37 +08:00
parent af43929b7a
commit 4f39f2a29e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -102,17 +102,22 @@ func ListNotebooks() (ret []*Box, err error) {
continue
}
if !ast.IsNodeIDPattern(dir.Name()) {
id := dir.Name()
if !ast.IsNodeIDPattern(id) {
continue
}
boxConf := conf.NewBoxConf()
boxDirPath := filepath.Join(util.DataDir, dir.Name())
boxDirPath := filepath.Join(util.DataDir, id)
boxConfPath := filepath.Join(boxDirPath, ".siyuan", "conf.json")
isExistConf := filelock.IsExist(boxConfPath)
if !isExistConf {
// 数据同步时展开文档树操作可能导致数据丢失 https://github.com/siyuan-note/siyuan/issues/7129
logging.LogWarnf("found a corrupted box [%s]", boxDirPath)
if !IsUserGuide(id) {
// 数据同步时展开文档树操作可能导致数据丢失 https://github.com/siyuan-note/siyuan/issues/7129
logging.LogWarnf("found a corrupted box [%s]", boxDirPath)
} else {
continue
}
} else {
data, readErr := filelock.ReadFile(boxConfPath)
if nil != readErr {
@ -126,7 +131,6 @@ func ListNotebooks() (ret []*Box, err error) {
}
}
id := dir.Name()
icon := boxConf.Icon
if strings.Contains(icon, ".") { // 说明是自定义图标
// XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034