Use latest compatible instead of latest available for Install checkboxes #4152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problems
While setting up to reproduce KSP-CKAN/NetKAN#10157 in a fake 1.9.1 instance, I noticed some problems:
Causes
GUIMod.LatestAvailableMod
, which is the absolute most recent, rather thanGUIMod.LatestCompatibleMod
as it should have beenModuleInstaller.ImportFiles
only checks the SHA-1, so any module with only an SHA-256 indownload_hash
would fail to be detectedChanges
GUIMod.LatestCompatibleMod
, so the right version will be installed on old game versionsInstalledModule
instead of a just an identifier, and renders it withInstalledModule.ToString()
, which includes the version, install date, and whether it was auto-installed as a dependency of another modModuleInstaller.ImportFiles
first checks the SHA-256, then falls back to the SHA-1 if not foundRegistry.GetSha1Index
is renamedGetDownloadHashesIndex
and includes both SHA-256 and SHA-1 hashes as keys in the dictionary it returns.Registry.GetDownloadHashIndex
is renamed toGetDownloadUrlHashIndex
Get*Index
functions are refactored (and LINQified) to cache their calculated dictionaries in between repo updates, in case the user needs them multiple times in a row