An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve exporting data https://github.com/siyuan-note/siyuan/issues/13500
Daniel560af8e54299
diff --git a/kernel/model/export.go b/kernel/model/export.goindex 586dbef32e..110996a590 100644--- a/kernel/model/export.go+++ b/kernel/model/export.go@@ -1707,6 +1707,11 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (}// 导出引用的资源文件+ assetPathMap, err := allAssetAbsPaths()+ if nil != err {+ logging.LogWarnf("get assets abs path failed: %s", err)+ return+ }copiedAssets := hashset.New()for _, tree := range trees {var assets []string@@ -1730,14 +1735,14 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (continue}- srcPath, assetErr := GetAssetAbsPath(asset)- if nil != assetErr {- logging.LogWarnf("get asset [%s] abs path failed: %s", asset, assetErr)+ srcPath := assetPathMap[asset]+ if "" == srcPath {+ logging.LogWarnf("get asset [%s] abs path failed", asset)continue}destPath := filepath.Join(exportFolder, asset)- assetErr = filelock.Copy(srcPath, destPath)+ assetErr := filelock.Copy(srcPath, destPath)if nil != assetErr {logging.LogErrorf("copy asset from [%s] to [%s] failed: %s", srcPath, destPath, assetErr)continue@@ -1795,9 +1800,9 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (}destPath := filepath.Join(exportFolder, asset.Content)- srcPath, assetErr := GetAssetAbsPath(asset.Content)- if nil != assetErr {- logging.LogWarnf("get asset [%s] abs path failed: %s", asset.Content, assetErr)+ srcPath := assetPathMap[asset.Content]+ if "" == srcPath {+ logging.LogWarnf("get asset [%s] abs path failed", asset.Content)continue}@@ -3150,6 +3155,11 @@ func exportPandocConvertZip(baseFolderName string, docPaths []string,}wrotePathHash := map[string]string{}+ assetsPathMap, err := allAssetAbsPaths()+ if nil != err {+ logging.LogWarnf("get assets abs path failed: %s", err)+ return+ }luteEngine := util.NewLute()for i, p := range docPaths {@@ -3187,15 +3197,14 @@ func exportPandocConvertZip(baseFolderName string, docPaths []string,continue}- srcPath, err := GetAssetAbsPath(asset)- if err != nil {- logging.LogWarnf("get asset [%s] abs path failed: %s", asset, err)+ srcPath := assetsPathMap[asset]+ if "" == srcPath {+ logging.LogWarnf("get asset [%s] abs path failed", asset)continue}destPath := filepath.Join(writeFolder, asset)- err = filelock.Copy(srcPath, destPath)- if err != nil {+ if copyErr := filelock.Copy(srcPath, destPath); copyErr != nil {logging.LogErrorf("copy asset from [%s] to [%s] failed: %s", srcPath, destPath, err)continue}