From 78a56fc083f0027814c145446a6bf8abc52ff0ea Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Fri, 13 Oct 2023 14:48:29 +0200 Subject: [PATCH] v2.4.7 Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/plugins/default/gdrivesync.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pwnagotchi/plugins/default/gdrivesync.py b/pwnagotchi/plugins/default/gdrivesync.py index 8fa4b958..00e117aa 100644 --- a/pwnagotchi/plugins/default/gdrivesync.py +++ b/pwnagotchi/plugins/default/gdrivesync.py @@ -36,10 +36,9 @@ class GdriveSync(plugins.Plugin): # Function to get the folder ID by its name def get_folder_id_by_name(self, drive, folder_name): file_list = drive.ListFile({'q': "name="+folder_name+" and mimetype='application/vnd.google-apps.folder' and trashed=false"}).GetList() - for file in file_list: - if file['title'] == folder_name: - return file['id'] - return None + if 'files' in file_list and len(file_list['files']) > 0: + return file_list['files'][0]['id'] + return None def on_loaded(self): # client_secrets.json needs to be not empty