Handle multiple game versions from Curse #2616
Merged
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.
Background
Curse lets mod authors select multiple game versions (this list appears upon hovering the "+9" with the mouse):
This data appears in a
versions
property in the API:https://api.cfwidget.com/project/283006
Problem
Currently Netkan ignores those values; instead, the single game version from the
version
property in the API is used, and any broader compatibility can only be set with a$vref
or with overrides.I think the quirks of the selection of the value of that property somehow caused KSP-CKAN/NetKAN#6622.
Changes
Now we parse the full game version list. This is done with by adding a new
CurseFile.versions
property and extendingJsonConvertKSPVersion
to support arrays.If there are multiple game versions, we set
ksp_version_min
to the earliest andksp_version_max
to the latest. Otherwise the single game version is set toksp_version
, as before.Fixes KSP-CKAN/NetKAN#6622 better than KSP-CKAN/NetKAN#6674 did (the latter can now be reverted).