Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Dont download data if file is skipped #347

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix support team drives
  • Loading branch information
Elbandi committed Jan 22, 2021
commit ff5def1a5ec210cd6e09a0f845710c6ab08ac3a3
2 changes: 1 addition & 1 deletion drive/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (self *Drive) Delete(args DeleteArgs) error {
}

func (self *Drive) deleteFile(fileId string) error {
err := self.service.Files.Delete(fileId).Do()
err := self.service.Files.Delete(fileId).SupportsAllDrives(true).Do()
if err != nil {
return fmt.Errorf("Failed to delete file: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion drive/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (self *Drive) listAllFiles(args listAllFilesArgs) ([]*drive.File, error) {

controlledStop := fmt.Errorf("Controlled stop")

err := self.service.Files.List().SupportsAllDrives(true).IncludeTeamDriveItems(true).Q(args.query).Fields(args.fields...).OrderBy(args.sortOrder).PageSize(pageSize).Pages(context.TODO(), func(fl *drive.FileList) error {
err := self.service.Files.List().SupportsAllDrives(true).Corpora("allDrives").IncludeItemsFromAllDrives(true).Q(args.query).Fields(args.fields...).OrderBy(args.sortOrder).PageSize(pageSize).Pages(context.TODO(), func(fl *drive.FileList) error {
files = append(files, fl.Files...)

// Stop when we have all the files we need
Expand Down
2 changes: 1 addition & 1 deletion drive/sync_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func (self *Drive) deleteRemoteFile(rf *RemoteFile, args UploadSyncArgs, try int

func (self *Drive) dirIsEmpty(id string) (bool, error) {
query := fmt.Sprintf("'%s' in parents", id)
fileList, err := self.service.Files.List().SupportsAllDrives(true).Q(query).Do()
fileList, err := self.service.Files.List().SupportsAllDrives(true).Corpora("allDrives").IncludeItemsFromAllDrives(true).Q(query).Do()
if err != nil {
return false, fmt.Errorf("Empty dir check failed: ", err)
}
Expand Down