From ccdee0420f74d1a500aefae60e71dddbbeff5f85 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 10 Jul 2025 10:45:46 +0100 Subject: [PATCH] imagekit: remove server side Copy method as it was downloading and uploading The Copy method was downloading the file and uploading it again rather than server side copying it. It looks from the docs that the upload process can read a URL so this might be possible, but the removed code is incorrect. --- backend/imagekit/imagekit.go | 25 ------------------------- docs/content/overview.md | 2 +- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/backend/imagekit/imagekit.go b/backend/imagekit/imagekit.go index 78be43e36..6a72422c8 100644 --- a/backend/imagekit/imagekit.go +++ b/backend/imagekit/imagekit.go @@ -800,35 +800,10 @@ func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error) return metadata, nil } -// Copy src to this remote using server-side move operations. -// -// This is stored with the remote path given. -// -// It returns the destination Object and a possible error. -// -// Will only be called if src.Fs().Name() == f.Name() -// -// If it isn't possible then return fs.ErrorCantMove -func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { - srcObj, ok := src.(*Object) - if !ok { - return nil, fs.ErrorCantMove - } - - file, err := srcObj.Open(ctx) - - if err != nil { - return nil, err - } - - return uploadFile(ctx, f, file, remote) -} - // Check the interfaces are satisfied. var ( _ fs.Fs = &Fs{} _ fs.Purger = &Fs{} _ fs.PublicLinker = &Fs{} _ fs.Object = &Object{} - _ fs.Copier = &Fs{} ) diff --git a/docs/content/overview.md b/docs/content/overview.md index 46f66fba8..3f0d568d6 100644 --- a/docs/content/overview.md +++ b/docs/content/overview.md @@ -516,7 +516,7 @@ upon backend-specific capabilities. | HiDrive | Yes | Yes | Yes | Yes | No | No | Yes | No | No | No | Yes | | HTTP | No | No | No | No | No | No | No | No | No | No | Yes | | iCloud Drive | Yes | Yes | Yes | Yes | No | No | No | No | No | No | Yes | -| ImageKit | Yes | Yes | Yes | No | No | No | No | No | No | No | Yes | +| ImageKit | Yes | No | Yes | No | No | No | No | No | No | No | Yes | | Internet Archive | No | Yes | No | No | Yes | Yes | No | No | Yes | Yes | No | | Jottacloud | Yes | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | | Koofr | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | Yes | Yes |