mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-12 15:11:10 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
424ff7776c
@ -1012,7 +1012,11 @@ func MoveDocs(fromPaths []string, toBoxID, toPath string) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fromPaths = util.FilterSelfChildDocs(fromPaths)
|
fromPaths = util.FilterMoveDocFromPaths(fromPaths, toPath)
|
||||||
|
if 1 > len(fromPaths) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
pathsBoxes := getBoxesByPaths(fromPaths)
|
pathsBoxes := getBoxesByPaths(fromPaths)
|
||||||
|
|
||||||
// 检查路径深度是否超过限制
|
// 检查路径深度是否超过限制
|
||||||
@ -1024,7 +1028,7 @@ func MoveDocs(fromPaths []string, toBoxID, toPath string) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
needShowProgress := 32 < len(fromPaths)
|
needShowProgress := 16 < len(fromPaths)
|
||||||
if needShowProgress {
|
if needShowProgress {
|
||||||
util.PushEndlessProgress(Conf.Language(116))
|
util.PushEndlessProgress(Conf.Language(116))
|
||||||
}
|
}
|
||||||
|
@ -175,6 +175,18 @@ func NormalizeEndpoint(endpoint string) string {
|
|||||||
return endpoint
|
return endpoint
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FilterMoveDocFromPaths(fromPaths []string, toPath string) (ret []string) {
|
||||||
|
tmp := FilterSelfChildDocs(fromPaths)
|
||||||
|
for _, fromPath := range tmp {
|
||||||
|
fromDir := strings.TrimSuffix(fromPath, ".sy")
|
||||||
|
if strings.HasPrefix(toPath, fromDir) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
ret = append(ret, fromPath)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func FilterSelfChildDocs(paths []string) (ret []string) {
|
func FilterSelfChildDocs(paths []string) (ret []string) {
|
||||||
sort.Slice(paths, func(i, j int) bool { return strings.Count(paths[i], "/") < strings.Count(paths[j], "/") })
|
sort.Slice(paths, func(i, j int) bool { return strings.Count(paths[i], "/") < strings.Count(paths[j], "/") })
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user