Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

quatrix: overwrite files on conflict during server-side move

Oksana Zhykina6b60e09ff2f6
diff --git a/backend/quatrix/api/types.go b/backend/quatrix/api/types.go
index 3cacdc228..0a55f5e60 100644
--- a/backend/quatrix/api/types.go
+++ b/backend/quatrix/api/types.go
@@ -6,8 +6,8 @@ import (
"time"
)
-// OverwriteOnCopyMode is a conflict resolve mode during copy. Files with conflicting names will be overwritten
-const OverwriteOnCopyMode = "overwrite"
+// OverwriteMode is a conflict resolve mode during copy or move. Files with conflicting names will be overwritten
+const OverwriteMode = "overwrite"
// ProfileInfo is a profile info about quota
type ProfileInfo struct {
diff --git a/backend/quatrix/quatrix.go b/backend/quatrix/quatrix.go
index 5165aaeba..dab1f5f77 100644
--- a/backend/quatrix/quatrix.go
+++ b/backend/quatrix/quatrix.go
@@ -729,7 +729,7 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
Resolve: true,
MTime: api.JSONTime(srcObj.ModTime(ctx)),
Name: dstLeaf,
- ResolveMode: api.OverwriteOnCopyMode,
+ ResolveMode: api.OverwriteMode,
}
result := &api.File{}
@@ -789,11 +789,12 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object,
}
params := &api.FileCopyMoveOneParams{
- ID: srcObj.id,
- Target: directoryID,
- Resolve: false,
- MTime: api.JSONTime(srcObj.ModTime(ctx)),
- Name: dstLeaf,
+ ID: srcObj.id,
+ Target: directoryID,
+ Resolve: true,
+ MTime: api.JSONTime(srcObj.ModTime(ctx)),
+ Name: dstLeaf,
+ ResolveMode: api.OverwriteMode,
}
var resp *http.Response