Skip to content

Commit 6869dd1

Browse files
authored
Merge pull request #55 from GDATAAdvancedAnalytics/fix-download
Fix download_file when not using json mode
2 parents 2ba08df + db83929 commit 6869dd1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/nextcloud/api_wrappers/webdav.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ def download_file(self, uid, path):
107107
# get timestamp of downloaded file from file property on Nextcloud
108108
# If it succeeded, set the timestamp to saved local file
109109
# If the timestamp string is invalid or broken, the timestamp is downloaded time.
110-
file_timestamp_str = (file_data.data[0].get('last_modified'))
110+
file_timestamp_str = (file_data.data[0].get('last_modified')
111+
if self.json_output
112+
else file_data.data[0].last_modified)
111113
file_timestamp = timestamp_to_epoch_time(file_timestamp_str)
112114
if isinstance(file_timestamp, int):
113115
os.utime(filename, (datetime.now().timestamp(), file_timestamp))

0 commit comments

Comments
 (0)