Fix show filelist query issue; add driveId to drive file fields (#1461)

* Fix show filelist query issue

If the user says: query "A or B" this becomes "'me' in owners and A or B" which is the same as "('me' in owners and A) or B" which gives incorrect results. The fix makes "'me' in owners and (A or B)"

* Add driveId to list of drive file fields
This commit is contained in:
Ross Scroggs
2021-12-17 08:51:32 -08:00
committed by GitHub
parent 99ab72df3f
commit 6ea6c0889b
3 changed files with 3 additions and 1 deletions

View File

@@ -3273,7 +3273,7 @@ def printDriveFileList(users):
'orderby', ', '.join(sorted(DRIVEFILE_ORDERBY_CHOICES_MAP)),
fieldName)
elif myarg == 'query':
query += f' and {sys.argv[i+1]}'
query += f' and ({sys.argv[i+1]})'
i += 2
elif myarg == 'fullquery':
query = sys.argv[i + 1]

View File

@@ -458,6 +458,7 @@ DRIVEFILE_FIELDS_CHOICES_MAP = {
'createddate': 'createdDate',
'createdtime': 'createdDate',
'description': 'description',
'driveid': 'driveId',
'editable': 'editable',
'explicitlytrashed': 'explicitlyTrashed',
'fileextension': 'fileExtension',