Add mod status badges + abbreviate query param on mod info#63
Add mod status badges + abbreviate query param on mod info#63TreehouseFalcon wants to merge 4 commits intogeode-sdk:mainfrom
abbreviate query param on mod info#63Conversation
There was a problem hiding this comment.
Do we want to serve these statically from the web application?
There was a problem hiding this comment.
Yeah I have a plan to add app storage (which would have to be served statically by the reverse proxy) in #60, though that PR is WIP.
I could backport the storage bit to main.
src/endpoints/mods.rs
Outdated
| } | ||
|
|
||
| // If abbreviate param is set, abbreviate download_count fields | ||
| let mut payload = serde_json::to_value(&the_mod).unwrap(); |
There was a problem hiding this comment.
This is a pretty janky solution, the data should remain as Mod.
Maybe create a custom type DownloadCount for the field that can be abbreviated that just holds the count and a boolean that tells if the Serialize impl result should be abbreviated or not?
https://serde.rs/impl-serialize.html, for reference.
There was a problem hiding this comment.
I've added a download_count model, is this what you're looking for?
|
Backported the storage in #64, just move the .svgs to |
Description
This pull proposes new Geode-branded status badges for use on the web! These badges are powered by Shields.IO and allow mod consumers to get automatically up-to-date information about the state of a mod by looking at the repository.
Badges can be generated from any of these four attributes:
versiongeode_versiongd_versiondownloadsAdditionally, there is a new
abbreviatedquery parameter added to the/mods/{id}route. This allows the Downloads badge to show a short-hand representation of download count.