Python: fix[support old version] fileType instead parsing

This commit is contained in:
Andrey Yumatov
2022-01-10 18:46:03 +03:00
parent 05706ff038
commit 57f6028829

View File

@ -60,7 +60,11 @@ def processSave(body, filename, usAddr):
newFilename = filename
curExt = fileUtils.getFileExt(filename) # get current file extension
downloadExt = "."+body.get('filetype') # get the extension of the downloaded file
downloadExt = body.get('filetype') # get the extension of the downloaded file
# Todo [Delete in version 7.0 or higher]
if (downloadExt == None):
downloadExt = fileUtils.getFileExt(download) # Support for versions below 7.0
# convert downloaded file to the file with the current extension if these extensions aren't equal
if (curExt != downloadExt):
@ -107,6 +111,11 @@ def processForceSave(body, filename, usAddr):
raise Exception("DownloadUrl is null")
curExt = fileUtils.getFileExt(filename) # get current file extension
downloadExt = body.get('fileType') # get the extension of the downloaded file
# Todo [Delete in version 7.0 or higher]
if (downloadExt == None):
downloadExt = fileUtils.getFileExt(download) # Support for versions below 7.0
newFilename = False
# convert downloaded file to the file with the current extension if these extensions aren't equal