From 5d6122a67dd2833753bd926255c36fbb52c154b7 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Fri, 13 Oct 2023 09:41:32 +0200 Subject: [PATCH] v2.4.7 Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/plugins/default/gdrivesync.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pwnagotchi/plugins/default/gdrivesync.py b/pwnagotchi/plugins/default/gdrivesync.py index 45b36a5c..16c206ac 100644 --- a/pwnagotchi/plugins/default/gdrivesync.py +++ b/pwnagotchi/plugins/default/gdrivesync.py @@ -68,11 +68,12 @@ class GdriveSync(plugins.Plugin): # if backup file does not exist, we will check for PwnagotchiBackups on gdrive. if not self.backup: # Assume 'PwnagotchiBackups' is the folder ID where backups are stored - backup_folder_id = 'PwnagotchiBackups' + backup_folder_name = 'PwnagotchiBackups' + backup_folder_id = self.get_folder_id_by_name(self.drive, backup_folder_name) # Get the list of files in the folder - file_list = self.drive.ListFile({'q': f"'{self.get_folder_id_by_name(self.drive, backup_folder_id)}" - f"' in parents and trashed=false"}).GetList() + file_list = self.drive.ListFile({'q': f"'{backup_folder_id}' in parents and trashed=false"}).GetList() + if not file_list: # Handle the case where no files were found logging.warning(f"[gDriveSync] No files found in the folder with ID {backup_folder_id}")