mirror of https://github.com/Xhofe/alist
fix: format % is missing verb at end of string
parent
73c0c0bf44
commit
d73a9e4734
|
@ -3,9 +3,10 @@ package fs
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
stdpath "path"
|
||||||
|
|
||||||
"github.com/alist-org/alist/v3/pkg/task"
|
"github.com/alist-org/alist/v3/pkg/task"
|
||||||
"github.com/alist-org/alist/v3/pkg/utils"
|
"github.com/alist-org/alist/v3/pkg/utils"
|
||||||
stdpath "path"
|
|
||||||
|
|
||||||
"github.com/alist-org/alist/v3/internal/driver"
|
"github.com/alist-org/alist/v3/internal/driver"
|
||||||
"github.com/alist-org/alist/v3/internal/model"
|
"github.com/alist-org/alist/v3/internal/model"
|
||||||
|
@ -31,7 +32,9 @@ func Copy(ctx context.Context, account driver.Driver, srcPath, dstPath string) (
|
||||||
return false, operations.Copy(ctx, account, srcActualPath, dstActualPath)
|
return false, operations.Copy(ctx, account, srcActualPath, dstActualPath)
|
||||||
}
|
}
|
||||||
// not in an account
|
// not in an account
|
||||||
CopyTaskManager.Add(fmt.Sprintf("copy [%s](%s) to [%s](%s)", srcAccount.GetAccount().VirtualPath, srcActualPath, dstAccount.GetAccount().VirtualPath, dstActualPath), func(task *task.Task) error {
|
CopyTaskManager.Add(
|
||||||
|
fmt.Sprintf("copy [%s](%s) to [%s](%s)", srcAccount.GetAccount().VirtualPath, srcActualPath, dstAccount.GetAccount().VirtualPath, dstActualPath),
|
||||||
|
func(task *task.Task) error {
|
||||||
return CopyBetween2Accounts(task.Ctx, srcAccount, dstAccount, srcActualPath, dstActualPath, task.SetStatus)
|
return CopyBetween2Accounts(task.Ctx, srcAccount, dstAccount, srcActualPath, dstActualPath, task.SetStatus)
|
||||||
})
|
})
|
||||||
return true, nil
|
return true, nil
|
||||||
|
@ -55,14 +58,18 @@ func CopyBetween2Accounts(ctx context.Context, srcAccount, dstAccount driver.Dri
|
||||||
}
|
}
|
||||||
srcObjPath := stdpath.Join(srcPath, obj.GetName())
|
srcObjPath := stdpath.Join(srcPath, obj.GetName())
|
||||||
dstObjPath := stdpath.Join(dstPath, obj.GetName())
|
dstObjPath := stdpath.Join(dstPath, obj.GetName())
|
||||||
CopyTaskManager.Add(fmt.Sprintf("copy [%s](%s) to [%s](%s)", srcAccount.GetAccount().VirtualPath, srcObjPath, dstAccount.GetAccount().VirtualPath, dstObjPath), func(task *task.Task) error {
|
CopyTaskManager.Add(
|
||||||
|
fmt.Sprintf("copy [%s](%s) to [%s](%s)", srcAccount.GetAccount().VirtualPath, srcObjPath, dstAccount.GetAccount().VirtualPath, dstObjPath),
|
||||||
|
func(task *task.Task) error {
|
||||||
return CopyBetween2Accounts(ctx, srcAccount, dstAccount, srcObjPath, dstObjPath, task.SetStatus)
|
return CopyBetween2Accounts(ctx, srcAccount, dstAccount, srcObjPath, dstObjPath, task.SetStatus)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CopyTaskManager.Add(fmt.Sprintf("copy [%s](%s) to [%s](%s)", srcAccount.GetAccount().VirtualPath, srcPath, dstAccount.GetAccount().VirtualPath, dstPath), func(task *task.Task) error {
|
CopyTaskManager.Add(
|
||||||
|
fmt.Sprintf("copy [%s](%s) to [%s](%s)", srcAccount.GetAccount().VirtualPath, srcPath, dstAccount.GetAccount().VirtualPath, dstPath),
|
||||||
|
func(task *task.Task) error {
|
||||||
return CopyFileBetween2Accounts(task.Ctx, srcAccount, dstAccount, srcPath, dstPath, func(percentage float64) {
|
return CopyFileBetween2Accounts(task.Ctx, srcAccount, dstAccount, srcPath, dstPath, func(percentage float64) {
|
||||||
task.SetStatus(fmt.Sprintf("uploading: %2.f%", percentage))
|
task.SetStatus(fmt.Sprintf("uploading: %2.f%%", percentage))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue