From 4b95496643d36184ffa1a7b78ae2d1150ecdf0b6 Mon Sep 17 00:00:00 2001 From: Petter Rasmussen Date: Sun, 21 Feb 2016 14:46:27 +0100 Subject: Add sync property and s/isSyncRoot/syncRoot/ --- drive/sync_download.go | 2 +- drive/sync_list.go | 2 +- drive/sync_upload.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drive/sync_download.go b/drive/sync_download.go index 5016cc1..4d84eea 100644 --- a/drive/sync_download.go +++ b/drive/sync_download.go @@ -95,7 +95,7 @@ func (self *Drive) getSyncRoot(rootId string) (*drive.File, error) { } // Ensure directory is a proper syncRoot - if _, ok := f.AppProperties["isSyncRoot"]; !ok { + if _, ok := f.AppProperties["syncRoot"]; !ok { return nil, fmt.Errorf("Provided id is not a sync root directory") } diff --git a/drive/sync_list.go b/drive/sync_list.go index 6ded606..e035239 100644 --- a/drive/sync_list.go +++ b/drive/sync_list.go @@ -16,7 +16,7 @@ type ListSyncArgs struct { func (self *Drive) ListSync(args ListSyncArgs) error { listArgs := listAllFilesArgs{ - query: "appProperties has {key='isSyncRoot' and value='true'}", + query: "appProperties has {key='syncRoot' and value='true'}", fields: []googleapi.Field{"nextPageToken", "files(id,name,mimeType,createdTime)"}, } files, err := self.listAllFiles(listArgs) diff --git a/drive/sync_upload.go b/drive/sync_upload.go index 7a0833a..96442e1 100644 --- a/drive/sync_upload.go +++ b/drive/sync_upload.go @@ -106,7 +106,7 @@ func (self *Drive) prepareSyncRoot(args UploadSyncArgs) (*drive.File, error) { } // Return directory if syncRoot property is already set - if _, ok := f.AppProperties["isSyncRoot"]; ok { + if _, ok := f.AppProperties["syncRoot"]; ok { return f, nil } @@ -124,7 +124,7 @@ func (self *Drive) prepareSyncRoot(args UploadSyncArgs) (*drive.File, error) { // Update directory with syncRoot property dstFile := &drive.File{ - AppProperties: map[string]string{"isSyncRoot": "true"}, + AppProperties: map[string]string{"sync": "true", "syncRoot": "true"}, } f, err = self.service.Files.Update(f.Id, dstFile).Fields(fields...).Do() @@ -260,7 +260,7 @@ func (self *Drive) createMissingRemoteDir(args createMissingRemoteDirArgs) (*dri Name: args.name, MimeType: DirectoryMimeType, Parents: []string{args.parentId}, - AppProperties: map[string]string{"syncRootId": args.rootId}, + AppProperties: map[string]string{"sync": "true", "syncRootId": args.rootId}, } if args.dryRun { @@ -298,7 +298,7 @@ func (self *Drive) uploadMissingFile(parentId string, lf *LocalFile, args Upload dstFile := &drive.File{ Name: lf.info.Name(), Parents: []string{parentId}, - AppProperties: map[string]string{"syncRootId": args.RootId}, + AppProperties: map[string]string{"sync": "true", "syncRootId": args.RootId}, } // Chunk size option -- cgit v1.2.3