From 9e4b68a364ab2b1da81ffdd4ae51cc40234a9ea7 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 14 Apr 2020 13:30:22 +0100 Subject: [PATCH] drive: server side copy docs use default description if empty When server side copying Google docs files we attempt to preserve the description. This patch makes it so that we use the default description if the original description was empty. See: https://github.com/rclone/rclone/commit/6fdd7149c1b68223c42cf5fe9994a4b78fa3d9bc#commitcomment-38008638 --- backend/drive/drive.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index fdad87af0..90a3fa89a 100755 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -2244,7 +2244,10 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, if err != nil { return nil, errors.Wrap(err, "failed to read description for Google Doc") } - createInfo.Description = info.Description + // set the description if there is one, or use the default if not + if info.Description != "" { + createInfo.Description = info.Description + } } else { // don't overwrite the description on copy for files // this should work for docs but it doesn't - it is probably a bug in Google Drive