mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-23 05:44:04 +08:00
fix: the recursive subdirectory moving bug (#4171)
This commit is contained in:
parent
5cba10446e
commit
220fd30830
@ -150,11 +150,12 @@ func FsRecursiveMove(c *gin.Context) {
|
||||
for !movingFiles.IsEmpty() {
|
||||
|
||||
movingFile := movingFiles.Pop()
|
||||
movingFilePath := fmt.Sprintf("%s/%s", filePathMap[movingFile], movingFile.GetName())
|
||||
movingFilePath := filePathMap[movingFile]
|
||||
movingFileName := fmt.Sprintf("%s/%s", movingFilePath, movingFile.GetName())
|
||||
if movingFile.IsDir() {
|
||||
// directory, recursive move
|
||||
subFilePath := movingFilePath
|
||||
subFiles, err := fs.List(c, subFilePath, &fs.ListArgs{Refresh: true})
|
||||
subFilePath := movingFileName
|
||||
subFiles, err := fs.List(c, movingFileName, &fs.ListArgs{Refresh: true})
|
||||
if err != nil {
|
||||
common.ErrorResp(c, err, 500)
|
||||
return
|
||||
@ -171,7 +172,7 @@ func FsRecursiveMove(c *gin.Context) {
|
||||
}
|
||||
|
||||
// move
|
||||
err := fs.Move(c, movingFilePath, dstDir, movingFiles.IsEmpty())
|
||||
err := fs.Move(c, movingFileName, dstDir, movingFiles.IsEmpty())
|
||||
if err != nil {
|
||||
common.ErrorResp(c, err, 500)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user