mirror of
https://github.com/siyuan-note/siyuan
synced 2026-04-21 13:37:52 +00:00
🎨 Treat the renaming of tags and assets as a data history Replace operation https://github.com/siyuan-note/siyuan/issues/17407
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
935458d039
commit
1654612867
1 changed files with 3 additions and 0 deletions
|
|
@ -935,6 +935,7 @@ func RenameAsset(oldPath, newName string) (newPath string, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
historyDir, err := getHistoryDir(HistoryOpReplace, time.Now())
|
||||
luteEngine := util.NewLute()
|
||||
for _, notebook := range notebooks {
|
||||
pages := pagedPaths(filepath.Join(util.DataDir, notebook.ID), 32)
|
||||
|
|
@ -967,6 +968,7 @@ func RenameAsset(oldPath, newName string) (newPath string, err error) {
|
|||
continue
|
||||
}
|
||||
|
||||
generateTreeHistory(historyDir, tree)
|
||||
treenode.UpsertBlockTree(tree)
|
||||
sql.UpsertTreeQueue(tree)
|
||||
|
||||
|
|
@ -974,6 +976,7 @@ func RenameAsset(oldPath, newName string) (newPath string, err error) {
|
|||
}
|
||||
}
|
||||
}
|
||||
indexHistoryDir(filepath.Base(historyDir), util.NewLute())
|
||||
|
||||
storageAvDir := filepath.Join(util.DataDir, "storage", "av")
|
||||
if gulu.File.IsDir(storageAvDir) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue