Skip to content
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

Sort mods satisfying the same recommendation by download count #4007

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

HebaruSan
Copy link
Member

Motivation

In #3934, we sorted the providing mods prompt by download count to make it easier for users to find the mods that they're most likely to want.

EnvironmentalVisualEnhancements recommends rather than depends on its config module, so when you install it, instead of the providing mods prompt, it uses the recommendations prompt, which is sorted by the related mod column and otherwise tries to reflect the ordering from the mods' relationships, but doesn't do any particular sorting within a group of mods satisfying a virtual module recommendation:

image

Changes

Now Registry.LatestAvailableWithProvides, which is used to satisfy virtual module recommendations, sorts its returned list by download count, which puts the most commonly used EVE configs at the top:

image

@JonnyOThan, does that list look right to you? I noticed a few spots where the download counts appear to be slightly out of order, but I'm not sure whether those are actual problems or just some harmless quirk elsewhere in the sorting logic.

Fixes #4004.

@HebaruSan HebaruSan added Enhancement New features or functionality Easy This is easy to fix GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN Relationships Issues affecting depends, recommends, etc. labels Jan 23, 2024
@JonnyOThan
Copy link
Contributor

I’m a bit surprised that GPP would be higher than spectra but having BoulderCo (heh) and AVP at the top certainly looks right.

@HebaruSan
Copy link
Member Author

To reassure myself, I dug up the identifiers to get the actual numbers:

jq '{"EnvironmentalVisualEnhancements-HR","AstronomersVisualPack","GPPCloudsHighRes","GPPCloudsLowRes","Spectra","RSSVE-HR","RSSVE-LR","JNSQ","PhotoRealisticVisualEnhancement","PhotoRealisticVisualEnhancement-LowRes","WhirligigWorld","StockPlanetaryUniversalRevamp","SciFiVisualEnhancements"}' download_counts.json
{
  "EnvironmentalVisualEnhancements-HR": 2699354,
  "AstronomersVisualPack": 1122970,
  "GPPCloudsHighRes": 220474,
  "GPPCloudsLowRes": 220458,
  "Spectra": 163811,
  "RSSVE-HR": 146983,
  "RSSVE-LR": 146911,
  "JNSQ": 51429,
  "PhotoRealisticVisualEnhancement": 9430,
  "PhotoRealisticVisualEnhancement-LowRes": 9384,
  "WhirligigWorld": 7945,
  "StockPlanetaryUniversalRevamp": 4826,
  "SciFiVisualEnhancements": 22
}

The download counting algorithm could probably be improved here, but at a glance, I think the sort itself is working.

@HebaruSan HebaruSan merged commit 0bd6f6c into KSP-CKAN:master Jan 24, 2024
8 checks passed
@HebaruSan HebaruSan deleted the feature/sort-providers branch January 24, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Easy This is easy to fix Enhancement New features or functionality GUI Issues affecting the interactive GUI Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recommendations are not sorted by download count
2 participants