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: 6fdd7149c1 (commitcomment-38008638)
This commit is contained in:
Nick Craig-Wood 2020-04-14 13:30:22 +01:00
parent 044a3b3920
commit 9e4b68a364
1 changed files with 4 additions and 1 deletions

View File

@ -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