Game Version types, indexing, and bugfixes (#91)

* Add types to game_versions, allow filtering by version type

- Fixes an issue with version numbers in the initial mod indexing
  queue
- Modifies the /api/v1/categories/game_versions route to take an
  optional query parameter `type` to filter the listed game versions
- Creating tags is now idempotent
- Creating game_versions now requires a JSON body that specifies
  the version type

* Implement automatic indexing of new Minecraft versions

It's currently set to run every 6 hours and isn't configurable; we
could add config for it, but it doesn't seem likely to be rate
limited or have issues with frequency.
This commit is contained in:
Aeledfyr
2020-10-28 11:11:49 -05:00
committed by GitHub
parent ef28459b61
commit a4ba6d1444
7 changed files with 270 additions and 80 deletions

View File

@@ -460,10 +460,10 @@ async fn mod_create_inner(
status: status_id,
};
let versions_list = mod_builder
let versions_list = mod_create_data
.initial_versions
.iter()
.flat_map(|v| v.game_versions.iter().map(|id| id.0.to_string()))
.flat_map(|v| v.game_versions.iter().map(|name| name.0.clone()))
.collect::<std::collections::HashSet<String>>()
.into_iter()
.collect::<Vec<_>>();