8000 fix(copy): use Link and Put when the driver does not support copying … · AlistGo/alist@11b6a60 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 11b6a60

Browse files
authored
fix(copy): use Link and Put when the driver does not support copying (#7834)
1 parent 59e0228 commit 11b6a60

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/fs/copy.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package fs
33
import (
44
"context"
55
"fmt"
6+
"github.com/alist-org/alist/v3/internal/errs"
67
"net/http"
78
stdpath "path"
89
"time"
@@ -69,7 +70,10 @@ func _copy(ctx context.Context, srcObjPath, dstDirPath string, lazyCache ...bool
6970
}
7071
// copy if in the same storage, just call driver.Copy
7172
if srcStorage.GetStorage() == dstStorage.GetStorage() {
72-
return nil, op.Copy(ctx, srcStorage, srcObjActualPath, dstDirActualPath, lazyCache...)
73+
err = op.Copy(ctx, srcStorage, srcObjActualPath, dstDirActualPath, lazyCache...)
74+
if !errors.Is(err, errs.NotImplement) && !errors.Is(err, errs.NotSupport) {
75+
return nil, err
76+
}
7377
}
7478
if ctx.Value(conf.NoTaskKey) != nil {
7579
srcObj, err := op.Get(ctx, srcStorage, srcObjActualPath)

0 commit comments

Comments
 (0)
0