Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Commit 8b29869

Browse files
committed
check 'ownedByMe' and revert a debugging line
performance improved significantly
1 parent 31e808f commit 8b29869

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cleaner.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def get_deletion_list(service, pageToken, flags, pathFinder=None):
241241
pageToken=pageToken, includeRemoved=False,
242242
pageSize=pageSize, restrictToMyDrive=flags.mydriveonly,
243243
fields='nextPageToken,newStartPageToken,'
244-
'changes(fileId,time,file(name,parents,explicitlyTrashed))'
244+
'changes(fileId,time,file(name,parents,explicitlyTrashed,ownedByMe))'
245245
)
246246
response = execute_request(request, flags.timeout)
247247
items = response.get('changes', [])
@@ -251,10 +251,9 @@ def get_deletion_list(service, pageToken, flags, pathFinder=None):
251251
progress.clear_line()
252252
return deletionList, pageTokenBefore, pageToken
253253
progress.print_time(item['time'])
254-
if item['file']['explicitlyTrashed']:
254+
if item['file']['explicitlyTrashed'] and item['file']['ownedByMe']:
255255
if flags.fullpath:
256-
# disp = pathFinder.get_path(item['fileId'], fileRes=item['file'])
257-
disp = pathFinder.get_path(item['fileId'])
256+
disp = pathFinder.get_path(item['fileId'], fileRes=item['file'])
258257
else:
259258
disp = item['file']['name']
260259
progress.found(item['time'], disp)

0 commit comments

Comments
 (0)