summaryrefslogtreecommitdiff
path: root/src/apis/modrinth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/apis/modrinth.rs')
-rw-r--r--src/apis/modrinth.rs9
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
5use crate::{ 5use 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
170pub async fn versions(api: &str, id: String, list: List) -> Vec<Version> { 170pub 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();