Skip to content

Commit a35549d

Browse files
committed
Fix #217 - installer trying to install wrong mod when switching mods
- Broken by fb82b19 as I did not include the self.targetID as part of the caching key
1 parent ac2c5ff commit a35549d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

fileVersionManagement.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def parseRequirementsList(scanPath, requirementsListString):
6969

7070

7171
class VersionManager:
72-
cachedRemoteVersionInfo = None
72+
cachedRemoteVersionInfo = {}
7373
localVersionFileName = "installedVersionData.json"
7474
def userDidPartialReinstall(self, gameInstallTimeProbePath):
7575
"""
@@ -114,11 +114,10 @@ def __init__(self, fullInstallConfiguration, modFileList, localVersionFolder, da
114114
else:
115115
try:
116116
# Cache the remote version info to avoid continuously re-downloading it
117-
if VersionManager.cachedRemoteVersionInfo is None:
117+
self.remoteVersionInfo = VersionManager.cachedRemoteVersionInfo.get(self.targetID)
118+
if self.remoteVersionInfo is None:
118119
self.remoteVersionInfo = getRemoteVersion(self.targetID)
119-
VersionManager.cachedRemoteVersionInfo = self.remoteVersionInfo
120-
else:
121-
self.remoteVersionInfo = VersionManager.cachedRemoteVersionInfo
120+
VersionManager.cachedRemoteVersionInfo[self.targetID] = self.remoteVersionInfo
122121
except Exception as error:
123122
self.remoteVersionInfo = None
124123
print("VersionManager: Error while retrieving remote version information {}".format(error))

0 commit comments

Comments
 (0)