diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b4a9b3..ab62fe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for Ferium +## [3.20.1] - 16.04.2022 + +When picking a file from a version, Ferium will get the primary file rather than the first file + ## [3.20.0] - 16.04.2022 - Added a `Downloadable` struct that represents (and be converted from) a mod file from Modrinth, GitHub Releases, or CurseForge diff --git a/Cargo.lock b/Cargo.lock index 6ea4b26..529a39a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -499,7 +499,7 @@ dependencies = [ [[package]] name = "ferium" -version = "3.20.0" +version = "3.20.1" dependencies = [ "anyhow", "bytes", diff --git a/Cargo.toml b/Cargo.toml index a6470cb..232e2e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ferium" -version = "3.20.0" +version = "3.20.1" edition = "2021" authors = ["Ilesh Thiada (theRookieCoder) ", "Daniel Hauck (SolidTux)"] description = "Ferium is a CLI program for managing Minecraft mods from Modrinth, CurseForge, and Github Releases" diff --git a/src/main.rs b/src/main.rs index d744139..dea13ef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -215,7 +215,14 @@ async fn actual_main() -> Result<()> { ModIdentifier::ModrinthProject(project_id) => { upgrade::modrinth(&modrinth, profile, project_id, no_patch_check) .await - .map(|ok| ok.files[0].clone().into()) + .map(|version| { + for file in &version.files { + if file.primary { + return file.clone().into(); // stupid `clones()`s, I WANT POLONIUS + } + } + version.files[0].clone().into() // stupid `clones()`s, I WANT POLONIUS + }) }, ModIdentifier::GitHubRepository(full_name) => { upgrade::github(&github.repos(&full_name.0, &full_name.1), profile)