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

Commit

Permalink
check 'ownedByMe' and revert a debugging line
Browse files Browse the repository at this point in the history
performance improved significantly
  • Loading branch information
cfbao committed Jul 21, 2017
1 parent 31e808f commit 8b29869
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def get_deletion_list(service, pageToken, flags, pathFinder=None):
pageToken=pageToken, includeRemoved=False,
pageSize=pageSize, restrictToMyDrive=flags.mydriveonly,
fields='nextPageToken,newStartPageToken,'
'changes(fileId,time,file(name,parents,explicitlyTrashed))'
'changes(fileId,time,file(name,parents,explicitlyTrashed,ownedByMe))'
)
response = execute_request(request, flags.timeout)
items = response.get('changes', [])
Expand All @@ -251,10 +251,9 @@ def get_deletion_list(service, pageToken, flags, pathFinder=None):
progress.clear_line()
return deletionList, pageTokenBefore, pageToken
progress.print_time(item['time'])
if item['file']['explicitlyTrashed']:
if item['file']['explicitlyTrashed'] and item['file']['ownedByMe']:
if flags.fullpath:
# disp = pathFinder.get_path(item['fileId'], fileRes=item['file'])
disp = pathFinder.get_path(item['fileId'])
disp = pathFinder.get_path(item['fileId'], fileRes=item['file'])
else:
disp = item['file']['name']
progress.found(item['time'], disp)
Expand Down

0 comments on commit 8b29869

Please sign in to comment.