From 42be836928b0e86d877a16013244cd0f1600d93d Mon Sep 17 00:00:00 2001 From: Neocky Date: Mon, 21 Jun 2021 10:18:52 +0200 Subject: [PATCH] Fixed wrong folder was used when trying to download plugin Changes: - fixed wrong folder use while downloading plugins - made code a little bit cleaner --- src/plugin/plugin_downloader.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/plugin/plugin_downloader.py b/src/plugin/plugin_downloader.py index b41cd0c..ba618e0 100644 --- a/src/plugin/plugin_downloader.py +++ b/src/plugin/plugin_downloader.py @@ -78,21 +78,19 @@ def searchPackage(ressourceName): ressourceSelected = ressourceSelected - 1 ressourceId = packageName[ressourceSelected]["id"] if not configValues.localPluginFolder: - try: - if configValues.sftp_seperateDownloadPath is True: - getSpecificPackage(ressourceId, configValues.sftp_pathToSeperateDownloadPath) - else: - getSpecificPackage(ressourceId, configValues.sftp_folderPath) - except HTTPError as err: - print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite) + if configValues.sftp_seperateDownloadPath is True: + pluginDownloadPath = configValues.sftp_pathToSeperateDownloadPath + else: + pluginDownloadPath = configValues.sftp_folderPath else: - try: - if configValues.seperateDownloadPath is True: - getSpecificPackage(ressourceId, configValues.pathToPluginFolder) - else: - getSpecificPackage(ressourceId, configValues.pathToSeperateDownloadPath) - except HTTPError as err: - print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite) + if configValues.seperateDownloadPath is True: + pluginDownloadPath = configValues.pathToSeperateDownloadPath + else: + pluginDownloadPath = configValues.pathToPluginFolder + try: + getSpecificPackage(ressourceId, pluginDownloadPath) + except HTTPError as err: + print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite) def downloadSpecificVersion(ressourceId, downloadPath, versionID='latest'):