Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: 资源文件重命名 https://github.com/siyuan-note/siyuan/issues/3454

Liang Ding33ea08dcd0b8
diff --git a/kernel/model/assets.go b/kernel/model/assets.go
index 7c1bab71bc..ee0b6dd9a2 100644
--- a/kernel/model/assets.go
+++ b/kernel/model/assets.go
@@ -462,7 +462,7 @@ func RenameAsset(oldPath, newName string) (err error) {
return
}
- newPath := util.AssetName(newName) + filepath.Ext(oldPath)
+ newPath := "assets/" + util.AssetName(newName) + filepath.Ext(oldPath)
if err = gulu.File.Copy(filepath.Join(util.DataDir, oldPath), filepath.Join(util.DataDir, newPath)); nil != err {
util.LogErrorf("copy asset [%s] failed: %s", oldPath, err)
return
@@ -485,7 +485,7 @@ func RenameAsset(oldPath, newName string) (err error) {
}
if !bytes.Contains(data, []byte(oldPath)) {
- return
+ continue
}
data = bytes.Replace(data, []byte(oldPath), []byte(newPath), -1)