Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-10-13 14:55:39 +02:00
parent d24a6cd4e4
commit a08a14ac0d

View File

@ -69,11 +69,9 @@ class GdriveSync(plugins.Plugin):
# if backup file does not exist, we will check for backup folder on gdrive. # if backup file does not exist, we will check for backup folder on gdrive.
if not self.backup: if not self.backup:
logging.info("test1")
# Use self.options['backup_folder'] as 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_name = self.options['backup_folder']
backup_folder_id = self.get_folder_id_by_name(self.drive, backup_folder_name) backup_folder_id = self.get_folder_id_by_name(self.drive, backup_folder_name)
logging.info("test1.1")
if not backup_folder_id: if not backup_folder_id:
# If the folder doesn't exist, create it # If the folder doesn't exist, create it
@ -84,7 +82,7 @@ class GdriveSync(plugins.Plugin):
print(f"Created folder '{backup_folder_name}' with ID: {backup_folder_id}") print(f"Created folder '{backup_folder_name}' with ID: {backup_folder_id}")
# Continue with the rest of the code using backup_folder_id # Continue with the rest of the code using backup_folder_id
file_list = self.drive.ListFile({'q': f"'{backup_folder_id}' in parents and trashed=false"}).GetList() file_list = self.drive.ListFile({'q': f"name='{backup_folder_id}' and trashed=false"}).GetList()
if not file_list: if not file_list:
# Handle the case where no files were found # Handle the case where no files were found