fixed google drive files with multi-parents

This commit is contained in:
antelle 2018-01-03 22:41:06 +01:00
parent 30e3dae3e0
commit 1f45284639
1 changed files with 2 additions and 2 deletions

View File

@ -136,8 +136,8 @@ const StorageGDrive = StorageBase.extend({
if (err) { return callback && callback(err); }
this.logger.debug('List');
let query = dir === 'shared' ? 'sharedWithMe=true'
: dir ? `parents="${dir}"` : 'parents="root"';
query += 'and trashed=false';
: dir ? `"${dir}" in parents` : '"root" in parents';
query += ' and trashed=false';
const url = this._baseUrl + '/files?fields={fields}&q={q}'
.replace('{fields}', encodeURIComponent('files(id,name,mimeType,headRevisionId)'))
.replace('{q}', encodeURIComponent(query));