-
-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple download URLs per module #3877
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is super cool! Is there an example of what the outputed ckan will look like? Do we have the extra test coverage for this new functionality?
Here's the output of running netkan on the example netkan in the description: {
"spec_version": "v1.34",
"identifier": "SpaceWarp",
"name": "SpaceWarp",
"abstract": "A C# modding API for KSP2 built off of BepInEx",
"author": "cheese3660",
"version": "1.4.0",
"ksp_version_min": "0",
"ksp_version_max": "0.1.3",
"license": "MIT",
"resources": {
"homepage": "https://forum.kerbalspaceprogram.com/topic/218490-space-warp-v140-for-ksp2-013/",
"spacedock": "https://spacedock.info/mod/3277/Space%20Warp%20+%20BepInEx",
"repository": "https://github.com/SpaceWarpDev/SpaceWarp",
"bugtracker": "https://github.com/SpaceWarpDev/SpaceWarp/issues",
"remote-swinfo": "https://raw.githubusercontent.com/SpaceWarpDev/SpaceWarp/main/SpaceWarpBuildTemplate/swinfo.json",
"x_screenshot": "https://spacedock.info/content/cheese3660_103715/Space_Warp__BepInEx/Space_Warp__BepInEx-1678544917.png"
},
"tags": [
"plugin",
"library"
],
"depends": [
{
"name": "BepInEx"
},
{
"name": "UITKforKSP2"
}
],
"install": [
{
"find": "BepInEx",
"install_to": "GameRoot",
"include_only": [
"patchers",
"plugins"
]
}
],
"download": [
"https://spacedock.info/mod/3277/Space%20Warp%20+%20BepInEx/download/1.4.0",
"https://github.com/SpaceWarpDev/SpaceWarp/releases/download/spacewarp-1.4.0/spacewarp-release-1.4.0.zip"
],
"download_size": 10997877,
"download_hash": {
"sha1": "44713C69616854626578DD4B0DED54E2DAD3D1A7",
"sha256": "F4821C66B612074FA8364D6759E7CB21770DFA92C3EE3265EC6BCF69C81775D2"
},
"download_content_type": "application/zip",
"install_size": 26579768,
"release_date": "2023-07-19T00:16:14Z",
"x_generated_by": "netkan"
} Good point about tests. I'll look into that next (but not immediately)... |
Awesome. Maybe if we can get at least one on the expected netkan output we should be good enough for now. Our indexing should be ok (it's based around netkan anyway), but maybe need to check the mirrorer, as this is going from a key/value to key/list |
e17ad0a
to
985292b
Compare
OK, each commit now has some tests for the other stuff added in that commit, some of which is now more deterministic (e.g., not relying on Good point, the Infra will probably need some updates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool @HebaruSan ! Thanks for adding the extra tests 🙂
Motivation
SpaceDock has been having unexplained bandwidth problems recently, which have caused downloads to be very slow and sometimes truncated. This has been reported to the site owner (see KSP-SpaceDock/SpaceDock#463), but so far there's no sign of an improvement on the horizon.
Many mods are available on multiple hosts. Currently we have to choose just one to put in the netkan. This situation with SpaceDock would be easier to handle if we could support alternate download URLs.
Changes
download
to be a string or a list of stringsauthor
andlicense
)Registry.GetAllHosts
function scans the available modules in the registry and returns their URLs' hosts in order of frequencyversion
attributes. Thedownload
properties will be merged into a list.After this, we will be able to start adding alternate download sources for mods, and users will be able to prioritize GitHub over SpaceDock to avoid SpaceDock's bandwidth problems.
Fixes #487.
Fixes #1760.