diff options
author | fxqnlr <[email protected]> | 2023-05-03 08:01:51 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-05-03 08:01:51 +0200 |
commit | 245b6b9926033acd750503ab4947c9514c5e1aa6 (patch) | |
tree | 23734750cb3c80c69cde2599a2871adc3cd6b659 /src/apis | |
parent | 202ed4fcaa69e7de23e83fab0bae4ced6209eee4 (diff) | |
download | modlist-245b6b9926033acd750503ab4947c9514c5e1aa6.tar modlist-245b6b9926033acd750503ab4947c9514c5e1aa6.tar.gz modlist-245b6b9926033acd750503ab4947c9514c5e1aa6.zip |
fuck serde, plus maybe added quilt
Diffstat (limited to 'src/apis')
-rw-r--r-- | src/apis/modrinth.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/apis/modrinth.rs b/src/apis/modrinth.rs index 13e7a6d..525cc0d 100644 --- a/src/apis/modrinth.rs +++ b/src/apis/modrinth.rs | |||
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; | |||
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
6 | error::{ErrorType, MLError, MLE}, | 6 | error::{ErrorType, MLError, MLE}, |
7 | List, Modloader, | 7 | List, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | #[derive(Debug, Deserialize, Clone)] | 10 | #[derive(Debug, Deserialize, Clone)] |
@@ -168,14 +168,9 @@ pub async fn projects(api: &str, ids: Vec<String>) -> Vec<Project> { | |||
168 | 168 | ||
169 | ///Get applicable versions from mod_id with list context | 169 | ///Get applicable versions from mod_id with list context |
170 | pub async fn versions(api: &str, id: String, list: List) -> Vec<Version> { | 170 | pub async fn versions(api: &str, id: String, list: List) -> Vec<Version> { |
171 | let loaderstr = match list.modloader { | ||
172 | Modloader::Forge => String::from("forge"), | ||
173 | Modloader::Fabric => String::from("fabric"), | ||
174 | }; | ||
175 | |||
176 | let url = format!( | 171 | let url = format!( |
177 | r#"project/{}/version?loaders=["{}"]&game_versions=["{}"]"#, | 172 | r#"project/{}/version?loaders=["{}"]&game_versions=["{}"]"#, |
178 | id, loaderstr, list.mc_version | 173 | id, list.modloader.to_string(), list.mc_version |
179 | ); | 174 | ); |
180 | 175 | ||
181 | let data = get(api, &url).await.unwrap(); | 176 | let data = get(api, &url).await.unwrap(); |