Skip to content

Commit

Permalink
Fix #217 - installer trying to install wrong mod when switching mods
Browse files Browse the repository at this point in the history
 - Broken by fb82b19 as I did not include the self.targetID as part of the caching key
  • Loading branch information
drojf committed Aug 14, 2023
1 parent ac2c5ff commit a35549d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions fileVersionManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def parseRequirementsList(scanPath, requirementsListString):


class VersionManager:
cachedRemoteVersionInfo = None
cachedRemoteVersionInfo = {}
localVersionFileName = "installedVersionData.json"
def userDidPartialReinstall(self, gameInstallTimeProbePath):
"""
Expand Down Expand Up @@ -114,11 +114,10 @@ def __init__(self, fullInstallConfiguration, modFileList, localVersionFolder, da
else:
try:
# Cache the remote version info to avoid continuously re-downloading it
if VersionManager.cachedRemoteVersionInfo is None:
self.remoteVersionInfo = VersionManager.cachedRemoteVersionInfo.get(self.targetID)
if self.remoteVersionInfo is None:
self.remoteVersionInfo = getRemoteVersion(self.targetID)
VersionManager.cachedRemoteVersionInfo = self.remoteVersionInfo
else:
self.remoteVersionInfo = VersionManager.cachedRemoteVersionInfo
VersionManager.cachedRemoteVersionInfo[self.targetID] = self.remoteVersionInfo
except Exception as error:
self.remoteVersionInfo = None
print("VersionManager: Error while retrieving remote version information {}".format(error))
Expand Down

0 comments on commit a35549d

Please sign in to comment.