Fixed wrong folder was used when trying to download plugin

Changes:
- fixed wrong folder use while downloading plugins
- made code a little bit cleaner
This commit is contained in:
Neocky 2021-06-21 10:18:52 +02:00
parent 1e7b30a1be
commit 42be836928

View File

@ -78,21 +78,19 @@ def searchPackage(ressourceName):
ressourceSelected = ressourceSelected - 1 ressourceSelected = ressourceSelected - 1
ressourceId = packageName[ressourceSelected]["id"] ressourceId = packageName[ressourceSelected]["id"]
if not configValues.localPluginFolder: if not configValues.localPluginFolder:
try: if configValues.sftp_seperateDownloadPath is True:
if configValues.sftp_seperateDownloadPath is True: pluginDownloadPath = configValues.sftp_pathToSeperateDownloadPath
getSpecificPackage(ressourceId, configValues.sftp_pathToSeperateDownloadPath) else:
else: pluginDownloadPath = configValues.sftp_folderPath
getSpecificPackage(ressourceId, configValues.sftp_folderPath)
except HTTPError as err:
print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite)
else: else:
try: if configValues.seperateDownloadPath is True:
if configValues.seperateDownloadPath is True: pluginDownloadPath = configValues.pathToSeperateDownloadPath
getSpecificPackage(ressourceId, configValues.pathToPluginFolder) else:
else: pluginDownloadPath = configValues.pathToPluginFolder
getSpecificPackage(ressourceId, configValues.pathToSeperateDownloadPath) try:
except HTTPError as err: getSpecificPackage(ressourceId, pluginDownloadPath)
print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite) except HTTPError as err:
print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite)
def downloadSpecificVersion(ressourceId, downloadPath, versionID='latest'): def downloadSpecificVersion(ressourceId, downloadPath, versionID='latest'):