mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 10:30:13 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
d1ff28c535
7 changed files with 14 additions and 9 deletions
|
|
@ -200,6 +200,9 @@ func getFullHPathByID(c *gin.Context) {
|
|||
if !ok {
|
||||
return
|
||||
}
|
||||
if nil == arg["id"] {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
hPath, err := model.GetFullHPathByID(id)
|
||||
|
|
|
|||
|
|
@ -347,12 +347,12 @@ func setE2EEPasswd(c *gin.Context) {
|
|||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
if err := os.RemoveAll(filepath.Join(util.WorkspaceDir, "incremental")); nil != err {
|
||||
if err := os.RemoveAll(filepath.Join(util.TempDir, "incremental")); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
if err := os.MkdirAll(filepath.Join(util.WorkspaceDir, "incremental"), 0755); nil != err {
|
||||
if err := os.MkdirAll(filepath.Join(util.TempDir, "incremental"), 0755); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ func UploadBackup() (err error) {
|
|||
var pathJSON = fmt.Sprintf("%x", md5.Sum([]byte("paths.json"))) // 6952277a5a37c17aa6a7c6d86cd507b1
|
||||
|
||||
func encryptDataDir(passwd string) (encryptedDataDir string, err error) {
|
||||
encryptedDataDir = filepath.Join(util.WorkspaceDir, "incremental", "backup-encrypt")
|
||||
encryptedDataDir = filepath.Join(util.TempDir, "incremental", "backup-encrypt")
|
||||
if err = os.RemoveAll(encryptedDataDir); nil != err {
|
||||
return
|
||||
}
|
||||
|
|
@ -511,7 +511,7 @@ func encryptDataDir(passwd string) (encryptedDataDir string, err error) {
|
|||
}
|
||||
|
||||
func decryptDataDir(passwd string) (decryptedDataDir string, err error) {
|
||||
decryptedDataDir = filepath.Join(util.WorkspaceDir, "incremental", "backup-decrypt")
|
||||
decryptedDataDir = filepath.Join(util.TempDir, "incremental", "backup-decrypt")
|
||||
if err = os.RemoveAll(decryptedDataDir); nil != err {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -537,6 +537,7 @@ func clearWorkspaceTemp() {
|
|||
os.RemoveAll(filepath.Join(util.TempDir, "bazaar"))
|
||||
os.RemoveAll(filepath.Join(util.TempDir, "export"))
|
||||
os.RemoveAll(filepath.Join(util.TempDir, "import"))
|
||||
os.RemoveAll(filepath.Join(util.WorkspaceDir, "incremental")) // `工作空间/incremental/` 文件夹移动到 `工作空间/temp/incremental/` https://github.com/siyuan-note/siyuan/issues/5119
|
||||
|
||||
tmps, err := filepath.Glob(filepath.Join(util.TempDir, "*.tmp"))
|
||||
if nil != err {
|
||||
|
|
|
|||
|
|
@ -694,8 +694,9 @@ func loadNodesByMode(node *ast.Node, inputIndex, mode, size int, isDoc, isHeadin
|
|||
} else if isHeading {
|
||||
level := node.HeadingLevel
|
||||
for n := node.Next; nil != n; n = n.Next {
|
||||
if "1" == n.IALAttr("heading-fold") && ("1" == node.IALAttr("fold") && 0 == mode) {
|
||||
// 从大纲跳转折叠标题的下方标题时需要判断跳转的标题是否是折叠 https://github.com/siyuan-note/siyuan/issues/4920
|
||||
if "1" == n.IALAttr("heading-fold") {
|
||||
// 大纲点击折叠标题跳转聚焦 https://github.com/siyuan-note/siyuan/issues/4920
|
||||
// 多级标题折叠后上级块引浮窗中未折叠 https://github.com/siyuan-note/siyuan/issues/4997
|
||||
continue
|
||||
}
|
||||
if ast.NodeHeading == n.Type {
|
||||
|
|
|
|||
|
|
@ -663,7 +663,7 @@ func genCloudIndex(localDirPath string, excludes map[string]bool, calcHash bool)
|
|||
|
||||
func recoverSyncData(metaPath, indexPath string, modified map[string]bool) (decryptedDataDir string, upsertFiles []string, err error) {
|
||||
passwd := Conf.E2EEPasswd
|
||||
decryptedDataDir = filepath.Join(util.WorkspaceDir, "incremental", "sync-decrypt")
|
||||
decryptedDataDir = filepath.Join(util.TempDir, "incremental", "sync-decrypt")
|
||||
if err = os.RemoveAll(decryptedDataDir); nil != err {
|
||||
return
|
||||
}
|
||||
|
|
@ -772,7 +772,7 @@ func recoverSyncData(metaPath, indexPath string, modified map[string]bool) (decr
|
|||
}
|
||||
|
||||
func prepareSyncData(passwd string, unchangedDataList map[string]bool) (encryptedDataDir string, upsertList map[string]bool, err error) {
|
||||
encryptedDataDir = filepath.Join(util.WorkspaceDir, "incremental", "sync-encrypt")
|
||||
encryptedDataDir = filepath.Join(util.TempDir, "incremental", "sync-encrypt")
|
||||
if err = os.RemoveAll(encryptedDataDir); nil != err {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ func GetRhyResult(force bool, proxyURL string) (map[string]interface{}, error) {
|
|||
defer rhyResultLock.Unlock()
|
||||
|
||||
now := time.Now().Unix()
|
||||
if 3600 >= now-rhyResultCacheTime && !force {
|
||||
if 3600 >= now-rhyResultCacheTime && !force && 0 < len(cachedRhyResult) {
|
||||
return cachedRhyResult, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue