Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa
2026-05-17 21:18:24 +08:00
4 changed files with 3 additions and 31 deletions
+1 -13
View File
@@ -971,21 +971,9 @@ func getShorthandSavePath(c *gin.Context) {
}
notebook := arg["notebook"].(string)
box := model.Conf.Box(notebook)
var shorthandSaveBox string
shorthandSaveBox := model.Conf.FileTree.ShorthandSaveBox
shorthandSavePathTpl := model.Conf.FileTree.ShorthandSavePath
if nil != box {
boxConf := box.GetConf()
shorthandSaveBox = boxConf.ShorthandSaveBox
shorthandSavePathTpl = boxConf.ShorthandSavePath
}
if "" == shorthandSaveBox {
shorthandSaveBox = model.Conf.FileTree.ShorthandSaveBox
}
if "" == shorthandSavePathTpl {
shorthandSavePathTpl = model.Conf.FileTree.ShorthandSavePath
}
if "" == shorthandSaveBox {
shorthandSaveBox = notebook
-7
View File
@@ -411,13 +411,6 @@ func setNotebookConf(c *gin.Context) {
boxConf.DocCreateSavePath = util.TrimSpaceInPath(boxConf.DocCreateSavePath)
boxConf.ShorthandSavePath = util.TrimSpaceInPath(boxConf.ShorthandSavePath)
if "" != boxConf.ShorthandSavePath {
if !strings.HasPrefix(boxConf.ShorthandSavePath, "/") {
boxConf.ShorthandSavePath = "/" + boxConf.ShorthandSavePath
}
}
box.SaveConf(boxConf)
ret.Data = boxConf
}
-2
View File
@@ -30,8 +30,6 @@ type BoxConf struct {
DocCreateSavePath string `json:"docCreateSavePath"` // 新建文档存储路径
DailyNoteSavePath string `json:"dailyNoteSavePath"` // 新建日记存储路径
DailyNoteTemplatePath string `json:"dailyNoteTemplatePath"` // 新建日记使用的模板路径
ShorthandSaveBox string `json:"shorthandSaveBox"` // 闪念速记存储笔记本
ShorthandSavePath string `json:"shorthandSavePath"` // 闪念速记存储路径
SortMode int `json:"sortMode"` // 排序方式
}
+2 -9
View File
@@ -68,15 +68,7 @@ func MoveLocalShorthands(boxID string) (retIDs []string, err error) {
}
}
var hPath string
box := Conf.Box(boxID)
if nil != box {
boxConf := box.GetConf()
hPath = boxConf.ShorthandSavePath
}
if "" == hPath {
hPath = Conf.FileTree.ShorthandSavePath
}
hPath := Conf.FileTree.ShorthandSavePath
if "" != hPath {
var renderErr error
hPath, renderErr = RenderGoTemplate(hPath)
@@ -202,6 +194,7 @@ func MoveLocalShorthands(boxID string) (retIDs []string, err error) {
}
FlushTxQueue()
box := Conf.Box(boxID)
for _, id := range retIDs {
b, _ := GetBlock(id, nil)
PushCreate(box, b.Path, nil)