From 2f8f709dea13a98149a0b8420018afb3c9b70b38 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Fri, 13 Oct 2023 11:38:17 +0200 Subject: [PATCH] v2.4.7 Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/plugins/default/gdrivesync.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pwnagotchi/plugins/default/gdrivesync.py b/pwnagotchi/plugins/default/gdrivesync.py index 2ecd047c..1a04e061 100644 --- a/pwnagotchi/plugins/default/gdrivesync.py +++ b/pwnagotchi/plugins/default/gdrivesync.py @@ -35,7 +35,7 @@ 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': "mimeType='application/vnd.google-apps.folder' in parent and trashed=false"}).GetList() + file_list = drive.ListFile({'q': "'"+folder_name+"' in parents and trashed=false"}).GetList() for file in file_list: if file['title'] == folder_name: return file['id'] @@ -65,9 +65,9 @@ class GdriveSync(plugins.Plugin): # Create GoogleDrive instance self.drive = GoogleDrive(gauth) - # if backup file does not exist, we will check for PwnagotchiBackups on gdrive. + # if backup file does not exist, we will check for backup folder on gdrive. if not self.backup: - # Assume 'PwnagotchiBackups' is the folder ID where backups are stored + # Use self.options['backup_folder'] as the folder ID where backups are stored backup_folder_name = self.options['backup_folder'] backup_folder_id = self.get_folder_id_by_name(self.drive, backup_folder_name)