From ec8e48e4d78c44d5886a61643b84a701e245dd6a Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Sun, 3 Nov 2019 13:37:41 +0100 Subject: [PATCH] force json upload even when exists --- library/webdav.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/webdav.py b/library/webdav.py index 4224736..5c1b5bb 100644 --- a/library/webdav.py +++ b/library/webdav.py @@ -30,7 +30,7 @@ class WebDav: self.logger.info('WebDAV connection successfull') - def upload(self, file_name, f_id): + def upload(self, file_name, f_id, check_exists = True): """ uploads a file to webdav - checks for existence before doing so """ # upload with webdav @@ -47,7 +47,7 @@ class WebDav: self.loop.run_until_complete(self.webdav.mkdir(remote_upload_dir)) remote_file_path = remote_upload_dir + "/" + file_name - if self.loop.run_until_complete(self.webdav.exists(remote_file_path)): + if check_exists and self.loop.run_until_complete(self.webdav.exists(remote_file_path)): self.logger.info('[%s] File "%s" already exists on WebDAV', f_id, file_name) else: self.loop.run_until_complete( @@ -79,7 +79,7 @@ class WebDav: file.close() self.logger.info('[%s] Stored Lodur data locally in %s', f_id, file_path) - self.upload(file_name, f_id) + self.upload(file_name, f_id, False) def get_lodur_data(self, f_id): """ gets lodur data if it exists """