From 116a8021bb811faf8570f0a7442c00fad0288eb7 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 3 Apr 2021 14:21:20 +0100 Subject: [PATCH] drive: switch to the Drives API for looking up shared drives - fixes #3139 Before this change rclone used the deprecated teamdrives API. This change uses the new drives API (which seems to be the teamdrives API renames). --- backend/drive/drive.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index 80d5f24cd..32ccd9215 100755 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -2959,12 +2959,12 @@ func (f *Fs) makeShortcut(ctx context.Context, srcPath string, dstFs *Fs, dstPat } // List all team drives -func (f *Fs) listTeamDrives(ctx context.Context) (drives []*drive.TeamDrive, err error) { - drives = []*drive.TeamDrive{} - listTeamDrives := f.svc.Teamdrives.List().PageSize(100) +func (f *Fs) listTeamDrives(ctx context.Context) (drives []*drive.Drive, err error) { + drives = []*drive.Drive{} + listTeamDrives := f.svc.Drives.List().PageSize(100) var defaultFs Fs // default Fs with default Options for { - var teamDrives *drive.TeamDriveList + var teamDrives *drive.DriveList err = f.pacer.Call(func() (bool, error) { teamDrives, err = listTeamDrives.Context(ctx).Do() return defaultFs.shouldRetry(ctx, err) @@ -2972,7 +2972,7 @@ func (f *Fs) listTeamDrives(ctx context.Context) (drives []*drive.TeamDrive, err if err != nil { return drives, errors.Wrap(err, "listing Team Drives failed") } - drives = append(drives, teamDrives.TeamDrives...) + drives = append(drives, teamDrives.Drives...) if teamDrives.NextPageToken == "" { break }