Fixed big duplicate array issue for a plugin; Added seperate download path

Changes:
- Fixed big issue where two arrays would be created for a plugin and then everything else would fail
- added seperate location for downloaded files
This commit is contained in:
Neocky
2021-03-14 13:25:13 +01:00
parent 3e7beb477a
commit 7e9b5850be
4 changed files with 62 additions and 16 deletions

View File

@@ -162,7 +162,10 @@ def updateInstalledPackage(inputSelectedObject='all'):
getSpecificPackage(pluginId, checkConfig().sftp_folderPath)
pluginsUpdated += 1
else:
pluginPath = checkConfig().pathToPluginFolder
if checkConfig().seperateDownloadPath is True:
pluginPath = checkConfig().pathToSeperateDownloadPath
else:
pluginPath = checkConfig().pathToPluginFolder
pluginPath = f"{pluginPath}\\{plugin}"
os.remove(pluginPath)
getSpecificPackage(pluginId, checkConfig().pathToPluginFolder)
@@ -182,6 +185,10 @@ def updateInstalledPackage(inputSelectedObject='all'):
print(f"{latestVersion}".ljust(8))
if not checkConfig().localPluginFolder:
if checkConfig().sftp_seperateDownloadPath is True:
pluginPath = checkConfig().sftp_pathToSeperateDownloadPath
else:
pluginPath = checkConfig().sftp_folderPath
pluginPath = checkConfig().sftp_folderPath
pluginPath = f"{pluginPath}\\{plugin}"
sftp = createSFTPConnection()
@@ -190,7 +197,10 @@ def updateInstalledPackage(inputSelectedObject='all'):
pluginsUpdated += 1
else:
pluginPath = checkConfig().pathToPluginFolder
if checkConfig().seperateDownloadPath is True:
pluginPath = checkConfig().pathToSeperateDownloadPath
else:
pluginPath = checkConfig().pathToPluginFolder
pluginPath = f"{pluginPath}\\{plugin}"
os.remove(pluginPath)
getSpecificPackage(pluginId, checkConfig().pathToPluginFolder)
@@ -226,14 +236,15 @@ def getInstalledPlugin(localFileName, localFileVersion):
plugin_is_outdated = compareVersions(plugin_latest_version, updateVersion)
addToPluginList(pID, updateId, plugin_latest_version , plugin_is_outdated)
break
i = i + 1
else:
pID = None
updateId = None
plugin_latest_version = None
plugin_is_outdated = None
addToPluginList(pID, updateId, plugin_latest_version , plugin_is_outdated)
if plugin_match_found != True:
pID = None
updateId = None
plugin_latest_version = None
plugin_is_outdated = None
addToPluginList(pID, updateId, plugin_latest_version , plugin_is_outdated)
return pluginID