🎨 Improve asset name normalization when inserting/uploading https://github.com/siyuan-note/siyuan/issues/12255

This commit is contained in:
Daniel 2024-08-16 11:51:42 +08:00
parent 05167fefe4
commit 52877f42d0
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -100,7 +100,7 @@ func InsertLocalAssets(id string, assetPaths []string, isUpload bool) (succMap m
return
}
f.Close()
succMap[baseName] = "assets/" + fName
succMap[fName] = "assets/" + fName
}
}
IncSync()
@ -284,7 +284,7 @@ func Upload(c *gin.Context) {
os.RemoveAll(tmpDir2)
}
succMap[baseName] = strings.TrimPrefix(path.Join(relAssetsDirPath, fName), "/")
succMap[fName] = strings.TrimPrefix(path.Join(relAssetsDirPath, fName), "/")
}
}