From 0e76e35b6fcc040ec7c1e972c1fdcd72ce5dac48 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 24 Sep 2017 20:01:30 +0100 Subject: [PATCH] dropbox: Fix deprecation warnings for Move, MoveDir and Copy - fixes #1699 --- dropbox/dropbox.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dropbox/dropbox.go b/dropbox/dropbox.go index 4e0ae5091..ae876c83f 100644 --- a/dropbox/dropbox.go +++ b/dropbox/dropbox.go @@ -527,9 +527,9 @@ func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error) { arg.FromPath = srcObj.remotePath() arg.ToPath = dstObj.remotePath() var err error - var entry files.IsMetadata + var result *files.RelocationResult err = f.pacer.Call(func() (bool, error) { - entry, err = f.srv.Copy(&arg) + result, err = f.srv.CopyV2(&arg) return shouldRetry(err) }) if err != nil { @@ -537,7 +537,7 @@ func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error) { } // Set the metadata - fileInfo, ok := entry.(*files.FileMetadata) + fileInfo, ok := result.Metadata.(*files.FileMetadata) if !ok { return nil, fs.ErrorNotAFile } @@ -590,9 +590,9 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) { arg.FromPath = srcObj.remotePath() arg.ToPath = dstObj.remotePath() var err error - var entry files.IsMetadata + var result *files.RelocationResult err = f.pacer.Call(func() (bool, error) { - entry, err = f.srv.Move(&arg) + result, err = f.srv.MoveV2(&arg) return shouldRetry(err) }) if err != nil { @@ -600,7 +600,7 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) { } // Set the metadata - fileInfo, ok := entry.(*files.FileMetadata) + fileInfo, ok := result.Metadata.(*files.FileMetadata) if !ok { return nil, fs.ErrorNotAFile } @@ -644,7 +644,7 @@ func (f *Fs) DirMove(src fs.Fs, srcRemote, dstRemote string) error { arg.FromPath = srcPath arg.ToPath = dstPath err = f.pacer.Call(func() (bool, error) { - _, err = f.srv.Move(&arg) + _, err = f.srv.MoveV2(&arg) return shouldRetry(err) }) if err != nil {