Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
theRookieCoder authored Sep 3, 2022
1 parent 205f7be commit df41dbf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 35 deletions.
25 changes: 13 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libium"
version = "1.19.2"
version = "1.19.3"
edition = "2021"
authors = [
"Ilesh Thiada (theRookieCoder) <ileshkt@gmail.com>",
Expand Down Expand Up @@ -29,22 +29,23 @@ reqwest = { version = "~0.11.11", default-features = false, features = [
"rustls-tls",
"json",
] }
octocrab = { version = "~0.16.0", default-features = false, features = [
octocrab = { version = "~0.17.0", default-features = false, features = [
"rustls",
] }
tokio = { version = "~1.20.0", default-features = false, features = ["fs"] }
rfd = { version = "~0.9.1", default-features = false, optional = true }
serde = { version = "~1.0.139", features = ["derive"] }
clap = { version = "~3.2.12", features = ["derive"] }
tokio = { version = "~1.21.0", default-features = false, features = ["fs"] }
rfd = { version = "~0.10.0", default-features = false, optional = true }
serde = { version = "~1.0.144", features = ["derive"] }
clap = { version = "~3.2.20", features = ["derive"] }
url = { version = "~2.2.2", features = ["serde"] }
lazy_static = "~1.4.0"
urlencoding = "~2.1.0"
serde_json = "~1.0.82"
dialoguer = "~0.10.1"
thiserror = "~1.0.31"
ferinth = "~2.5.1"
urlencoding = "~2.1.2"
serde_json = "~1.0.85"
dialoguer = "~0.10.2"
thiserror = "~1.0.33"
ferinth = "~2.6.1"
# Bound to an older version because of octocrab
bytes = "~1.1.0"
furse = "~1.5.1"
furse = "~1.5.3"
home = "~0.5.3"
size = "~0.4.0"
zip = "~0.6.2"
34 changes: 12 additions & 22 deletions src/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@ use crate::{
config::structs::{ModIdentifier, Profile},
upgrade::mod_downloadable,
};
use ferinth::{
structures::{
project_structs::{Project, ProjectType},
version_structs::Version,
},
Ferinth,
};
use furse::{structures::file_structs::File, Furse};
use octocrab::{
models::{repos::Asset, Repository},
repos::RepoHandler,
};
use reqwest::StatusCode;
use std::sync::Arc;

Expand Down Expand Up @@ -86,11 +74,11 @@ impl From<octocrab::Error> for Error {
///
/// Returns the repository and the latest compatible asset
pub async fn github(
repo_handler: &RepoHandler<'_>,
repo_handler: &octocrab::repos::RepoHandler<'_>,
profile: &Profile,
should_check_game_version: Option<bool>,
should_check_mod_loader: Option<bool>,
) -> Result<(Repository, Asset)> {
) -> Result<(octocrab::models::Repository, octocrab::models::repos::Asset)> {
let repo = repo_handler.get().await?;
let repo_name = (
repo.owner.as_ref().unwrap().login.clone(),
Expand Down Expand Up @@ -138,20 +126,23 @@ pub async fn github(
///
/// Returns the project and the latest compatible version
pub async fn modrinth(
modrinth: Arc<Ferinth>,
modrinth: Arc<ferinth::Ferinth>,
project_id: &str,
profile: &Profile,
should_check_game_version: Option<bool>,
should_check_mod_loader: Option<bool>,
) -> Result<(Project, Version)> {
) -> Result<(
ferinth::structures::project_structs::Project,
ferinth::structures::version_structs::Version,
)> {
let project = modrinth.get_project(project_id).await?;
// Check if project has already been added
if profile.mods.iter().any(|mod_| {
mod_.name == project.title
|| ModIdentifier::ModrinthProject(project.id.clone()) == mod_.identifier
}) {
Err(Error::AlreadyAdded)
} else if project.project_type != ProjectType::Mod {
} else if project.project_type != ferinth::structures::project_structs::ProjectType::Mod {
Err(Error::NotAMod)
} else {
let version = mod_downloadable::get_latest_compatible_version(
Expand All @@ -171,13 +162,12 @@ pub async fn modrinth(
///
/// Returns the mod and the latest compatible file
pub async fn curseforge(
curseforge: Arc<Furse>,
project_id: i32,
curseforge: Arc<furse::Furse>,
project: &furse::structures::mod_structs::Mod,
profile: &Profile,
should_check_game_version: Option<bool>,
should_check_mod_loader: Option<bool>,
) -> Result<(furse::structures::mod_structs::Mod, File)> {
let project = curseforge.get_mod(project_id).await?;
) -> Result<furse::structures::file_structs::File> {
// Check if project has already been added
if profile.mods.iter().any(|mod_| {
mod_.name == project.name || ModIdentifier::CurseForgeProject(project.id) == mod_.identifier
Expand Down Expand Up @@ -210,7 +200,7 @@ pub async fn curseforge(
)
.ok_or(Error::Incompatible)?
.0;
Ok((project, file))
Ok(file)
} else {
Err(Error::NotAMod)
}
Expand Down
2 changes: 1 addition & 1 deletion src/config/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub enum ModLoader {
Fabric,
Forge,
}
#[derive(thiserror::Error, Debug, PartialEq)]
#[derive(thiserror::Error, Debug, PartialEq, Eq)]
#[error("The given string is not a mod loader")]
pub struct ModLoaderParseError {}
impl TryFrom<&String> for ModLoader {
Expand Down

0 comments on commit df41dbf

Please sign in to comment.