From c5f6fc3283c580f21404f5a7111915dbafdd796b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 25 Sep 2023 15:18:40 +0100 Subject: [PATCH] drive: add --drive-show-all-gdocs to allow unexportable gdocs to be server side copied Before this change, attempting to server side copy a google form would give this error No export formats found for "application/vnd.google-apps.form" Adding this flag allows the form to be server side copied but not downloaded. Fixes #6302 --- backend/drive/drive.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index 98eb9a0d5..9e1166bd8 100644 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -320,6 +320,25 @@ rather than shortcuts themselves when doing server side copies.`, Default: false, Help: "Skip google documents in all listings.\n\nIf given, gdocs practically become invisible to rclone.", Advanced: true, + }, { + Name: "show_all_gdocs", + Default: false, + Help: `Show all Google Docs including non-exportable ones in listings. + +If you try a server side copy on a Google Form without this flag, you +will get this error: + + No export formats found for "application/vnd.google-apps.form" + +However adding this flag will allow the form to be server side copied. + +Note that rclone doesn't add extensions to the Google Docs file names +in this mode. + +Do **not** use this flag when trying to download Google Docs - rclone +will fail to download them. +`, + Advanced: true, }, { Name: "skip_checksum_gphotos", Default: false, @@ -667,6 +686,7 @@ type Options struct { UseTrash bool `config:"use_trash"` CopyShortcutContent bool `config:"copy_shortcut_content"` SkipGdocs bool `config:"skip_gdocs"` + ShowAllGdocs bool `config:"show_all_gdocs"` SkipChecksumGphotos bool `config:"skip_checksum_gphotos"` SharedWithMe bool `config:"shared_with_me"` TrashedOnly bool `config:"trashed_only"` @@ -1528,6 +1548,8 @@ func (f *Fs) newObjectWithExportInfo( case f.opt.SkipGdocs: fs.Debugf(remote, "Skipping google document type %q", info.MimeType) return nil, fs.ErrorObjectNotFound + case f.opt.ShowAllGdocs: + return f.newDocumentObject(remote, info, "", info.MimeType) default: // If item MimeType is in the ExportFormats then it is a google doc if !isDocument {