Skip to content

Commit

Permalink
fix(copy): use Link and Put when the driver does not support copying (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
KirCute authored Jan 18, 2025
1 parent 59e0228 commit 11b6a60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/fs/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package fs
import (
"context"
"fmt"
"github.com/alist-org/alist/v3/internal/errs"
"net/http"
stdpath "path"
"time"
Expand Down Expand Up @@ -69,7 +70,10 @@ func _copy(ctx context.Context, srcObjPath, dstDirPath string, lazyCache ...bool
}
// copy if in the same storage, just call driver.Copy
if srcStorage.GetStorage() == dstStorage.GetStorage() {
return nil, op.Copy(ctx, srcStorage, srcObjActualPath, dstDirActualPath, lazyCache...)
err = op.Copy(ctx, srcStorage, srcObjActualPath, dstDirActualPath, lazyCache...)
if !errors.Is(err, errs.NotImplement) && !errors.Is(err, errs.NotSupport) {
return nil, err
}
}
if ctx.Value(conf.NoTaskKey) != nil {
srcObj, err := op.Get(ctx, srcStorage, srcObjActualPath)
Expand Down

0 comments on commit 11b6a60

Please sign in to comment.