aboutsummaryrefslogtreecommitdiffstats
path: root/drive/sync_download.go
diff options
context:
space:
mode:
authorjeff.yin2019-11-12 11:29:05 +0800
committerTeddy Wing2023-03-27 19:31:17 +0200
commit92d09a94cdd8c2f78bd9615b5eefd635c369fd87 (patch)
tree4b2dc6a7fd6c817efdc5d00e1b209e9bdda24a36 /drive/sync_download.go
parent8b463b2b53fa43270681f8b829f073fd60ab0b7b (diff)
downloadgdrive-master.tar.bz2
support teamdrivesHEADmaster
Diffstat (limited to 'drive/sync_download.go')
-rw-r--r--drive/sync_download.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/drive/sync_download.go b/drive/sync_download.go
index 58cd49c..9a88b61 100644
--- a/drive/sync_download.go
+++ b/drive/sync_download.go
@@ -3,13 +3,14 @@ package drive
import (
"bytes"
"fmt"
- "google.golang.org/api/drive/v3"
- "google.golang.org/api/googleapi"
"io"
"os"
"path/filepath"
"sort"
"time"
+
+ "google.golang.org/api/drive/v3"
+ "google.golang.org/api/googleapi"
)
type DownloadSyncArgs struct {
@@ -85,7 +86,7 @@ func (self *Drive) DownloadSync(args DownloadSyncArgs) error {
func (self *Drive) getSyncRoot(rootId string) (*drive.File, error) {
fields := []googleapi.Field{"id", "name", "mimeType", "appProperties"}
- f, err := self.service.Files.Get(rootId).Fields(fields...).Do()
+ f, err := self.service.Files.Get(rootId).SupportsAllDrives(true).Fields(fields...).Do()
if err != nil {
return nil, fmt.Errorf("Failed to find root dir: %s", err)
}
@@ -191,7 +192,7 @@ func (self *Drive) downloadRemoteFile(id, fpath string, args DownloadSyncArgs, t
// Get timeout reader wrapper and context
timeoutReaderWrapper, ctx := getTimeoutReaderWrapperContext(args.Timeout)
- res, err := self.service.Files.Get(id).Context(ctx).Download()
+ res, err := self.service.Files.Get(id).SupportsAllDrives(true).Context(ctx).Download()
if err != nil {
if isBackendOrRateLimitError(err) && try < MaxErrorRetries {
exponentialBackoffSleep(try)