From 6ea6c0889ba1d8a03312b2d066dc988f22401477 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 17 Dec 2021 08:51:32 -0800 Subject: [PATCH] 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 --- src/GamCommands.txt | 1 + src/gam/__init__.py | 2 +- src/gam/var.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GamCommands.txt b/src/GamCommands.txt index ae86dd2c..af15a9eb 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -327,6 +327,7 @@ If an item contains spaces, it should be surrounded by ". description| editable| explicitlytrashed| + driveid| fileextension| filesize| foldercolorrgb| diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 5674af69..3a6a73d6 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -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] diff --git a/src/gam/var.py b/src/gam/var.py index 1fc6c809..debc2d2f 100644 --- a/src/gam/var.py +++ b/src/gam/var.py @@ -458,6 +458,7 @@ DRIVEFILE_FIELDS_CHOICES_MAP = { 'createddate': 'createdDate', 'createdtime': 'createdDate', 'description': 'description', + 'driveid': 'driveId', 'editable': 'editable', 'explicitlytrashed': 'explicitlyTrashed', 'fileextension': 'fileExtension',