aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Rasmussen2016-02-21 14:46:27 +0100
committerPetter Rasmussen2016-02-21 15:06:08 +0100
commit4b95496643d36184ffa1a7b78ae2d1150ecdf0b6 (patch)
tree03a328734b4b63fbef6f904c23a4e514ec3afdfc
parent428da4bcfedb3d3a2441d1d236f861e72ee8f5c6 (diff)
downloadgdrive-4b95496643d36184ffa1a7b78ae2d1150ecdf0b6.tar.bz2
Add sync property and s/isSyncRoot/syncRoot/
-rw-r--r--drive/sync_download.go2
-rw-r--r--drive/sync_list.go2
-rw-r--r--drive/sync_upload.go8
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