Modrinth Game Versions badge doesn't fetch all game versions
- Dominant language
- JavaScript
- Stars
- 27.2k
- Forks
- 5.6k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 46
Description
### Are you experiencing an issue with...
shields.io
### 🐞 Description
When using the Modrinth Game Versions badge, you would expect to get all supported game versions, but you only get the ones from the latest release
### 🔗 Link to the badge
https://shields.io/badges/modrinth-game-versions
### 💡 Possible Solution
The fix would be relatively simple.
Only the function `async handle({ projectId })` in `services/modrinth/modrinth-game-versions.service.js` would need to change from:
```js
async handle({ projectId }) {
const { 0: latest } = await this.fetchVersions({ projectId })
const versions = latest.game_versions
return this.constructor.render({ versions })
}
```
to:
```js
...
async handle({ projectId }) {
const data = await this.fetchVersions({ projectId })
const versions = [...new Set(
data.map(ver => ver.game_versions)
.reduce((prev, curr) => [...prev, ...curr]))
].sort()
return this.constructor.render({ versions })
}
```
Contributor guide
Research direction
Start in services/modrinth/modrinth-game-versions.service.js and inspect the async handle({ projectId }) function and its fetchVersions call. Confirm how the returned release data is shaped, then verify that the badge output contains every distinct game version across the releases, sorted consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100