From d7df065320d180b4388e4366370974a30237f219 Mon Sep 17 00:00:00 2001 From: Martin Kristensen Date: Thu, 20 Apr 2017 18:58:51 +0200 Subject: [PATCH] drive: reduce bandwidth by adding fields for partial responses Fixes #1346 --- drive/drive.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drive/drive.go b/drive/drive.go index f06f346e1..680a4e169 100644 --- a/drive/drive.go +++ b/drive/drive.go @@ -84,6 +84,7 @@ var ( "text/tab-separated-values": "tsv", } extensionToMimeType map[string]string + partialFields = googleapi.Field("items(id,downloadUrl,exportLinks,fileExtension,fullFileExtension,fileSize,labels,md5Checksum,modifiedDate,mimeType,title,owners)") ) // Register with Fs @@ -242,7 +243,7 @@ OUTER: for { var files *drive.FileList err = f.pacer.Call(func() (bool, error) { - files, err = list.Do() + files, err = list.Fields(partialFields).Do() return shouldRetry(err) }) if err != nil {