Skip to content

"Could not download mod list" - Github limits results to 1000 (there are >1000 mods now) #13951

@unciv-loof

Description

@unciv-loof

Is there an existing issue for this?

  • I have searched the existing issues

Game Version

4.18.1

Describe the bug

The github modlist downloader loads pages of 100 search results, but fails on the 11th page because only the first 1000 results are available through the github api.

My impression is that the download is always sorted by stars, so new mods with 0 stars may not be present in the first 1000 results. Especially discouraging for rookie modders.

https://api.github.com/search/repositories?q=%20topic:unciv-mod%20fork:true&sort:stars&per_page=100&page=11

{
  "message": "Only the first 1000 search results are available",
  "documentation_url": "https://docs.github.com/v3/search/",
  "status": "422"
}
[threadpool-daemon-2] [Github] [ERROR] Exception during GitHub download | java.io.IOException: Server returned HTTP response code: 422 for URL: https://api.github.com/search/repositories?q=%20topic:unciv-mod%20fork:true&sort:stars&per_page=100&page=11
...
at com.unciv.logic.github.Github.download(Github.kt:65)
at com.unciv.logic.github.Github.download$default(Github.kt:57)
at com.unciv.logic.github.Github.tryGetGithubReposWithTopic(Github.kt:348)
at com.unciv.logic.github.Github.tryGetGithubReposWithTopic$default(Github.kt:340)
at com.unciv.ui.screens.modmanager.ModManagementScreen$tryDownloadPage$1.invokeSuspend(ModManagementScreen.kt:285)
at com.unciv.ui.screens.modmanager.ModManagementScreen$tryDownloadPage$1.invoke(ModManagementScreen.kt)
at com.unciv.ui.screens.modmanager.ModManagementScreen$tryDownloadPage$1.invoke(ModManagementScreen.kt)
at com.unciv.utils.ConcurrencyKt$launchCrashHandling$1.invokeSuspend(Concurrency.kt:89)
...

Steps to Reproduce

Open game.
Go to Mods tab.
Wait for 1 minute.
Error pops up briefly inside unciv, and stack trace in terminal.

Screenshots

Image

Link to save file

No response

Operating System

Linux

Additional Information

This part may be relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions