From 008a8a471c0d82a462ce7671daa4ff4a55a713fc Mon Sep 17 00:00:00 2001 From: Erik de Keijzer Date: Tue, 6 Apr 2021 21:55:38 +0200 Subject: [PATCH] Simplified things --- octoprint_webdavbackup/__init__.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/octoprint_webdavbackup/__init__.py b/octoprint_webdavbackup/__init__.py index 233e696..ec920cb 100644 --- a/octoprint_webdavbackup/__init__.py +++ b/octoprint_webdavbackup/__init__.py @@ -35,7 +35,7 @@ def get_settings_defaults(self): upload_path="/", upload_name=None, check_space=False, - skip_path_check=True, + skip_path_check=False, upload_timelapse_path=None, upload_timelapse_name=None, upload_timelapse_video=True, @@ -74,6 +74,7 @@ def _convert_size(size_bytes): 'webdav_login': self._settings.get(["username"]), 'webdav_password': self._settings.get(["password"]), 'webdav_timeout': self._settings.get(["timeout"]), + 'disable_check': self._settings.get(["disable_path_check"]), } if event == "plugin_backup_backup_created": @@ -202,17 +203,7 @@ def _recursive_create_path(path): self._logger.error("Could not find WebDAV root, something is probably wrong with your settings.") return False - if skip_path_check: - do_upload = True - else: - self._logger.debug("We are going to recursively check " + upload_path) - try: - _recursive_create_path(upload_path) - do_upload = True - except: - do_upload = False - - if do_upload: + if _recursive_create_path(upload_path): try: self._logger.debug("Uploading " + local_file_path + " to " + upload_temp) davclient.upload_sync(remote_path=upload_temp, local_path=local_file_path)