Skip to content

Commit 49697e7

Browse files
Update ferinth to 2.12
1 parent d595047 commit 49697e7

File tree

11 files changed

+116
-135
lines changed

11 files changed

+116
-135
lines changed

Cargo.lock

Lines changed: 103 additions & 120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ reqwest = { version = "0.12", default-features = false, features = [
77
clap = { version = "4.5", features = ["derive", "env"] }
88
serde_json = "1.0"
99
octocrab = "0.44"
10-
ferinth = "2.11"
10+
ferinth = "2.12"
1111
furse = "1.6"
1212

1313
[patch.crates-io]

libium/src/add.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub async fn add(
141141
mr_ids.sort_unstable();
142142
mr_ids.dedup();
143143
MODRINTH_API
144-
.get_multiple_projects(&mr_ids.iter().map(AsRef::as_ref).collect_vec())
144+
.project_get_multiple(&mr_ids.iter().map(AsRef::as_ref).collect_vec())
145145
.await?
146146
} else {
147147
Vec::new()

libium/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ pub static CURSEFORGE_API: LazyLock<furse::Furse> = LazyLock::new(|| {
2525
)))
2626
});
2727

28-
pub static MODRINTH_API: LazyLock<ferinth::Ferinth> = LazyLock::new(|| {
29-
ferinth::Ferinth::new(
28+
pub static MODRINTH_API: LazyLock<ferinth::Ferinth<()>> = LazyLock::new(|| {
29+
ferinth::Ferinth::<()>::new(
3030
"ferium",
3131
// TODO: option_env!("CARGO_PKG_VERSION"),
3232
None,
3333
Some("Discord: therookiecoder"),
34-
None,
3534
)
36-
.expect("Could not build Modrinth client") // This should never fail since no `authorisation` token was provided
3735
});
3836

3937
pub static HOME: LazyLock<PathBuf> =

libium/src/modpack/add.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub async fn curseforge(config: &Config, project_id: i32) -> Result<Mod> {
7474
///
7575
/// Returns the project struct
7676
pub async fn modrinth(config: &Config, project_id: &str) -> Result<Project> {
77-
let project = MODRINTH_API.get_project(project_id).await?;
77+
let project = MODRINTH_API.project_get(project_id).await?;
7878

7979
// Check if project has already been added
8080
if config.modpacks.iter().any(|modpack| {

libium/src/scan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub async fn scan(
5353

5454
let (mr_results, cf_results) = try_join!(
5555
MODRINTH_API
56-
.get_versions_from_hashes(mr_hashes.clone())
56+
.version_get_from_multiple_hashes(mr_hashes.clone())
5757
.map_err(Error::from),
5858
CURSEFORGE_API
5959
.get_fingerprint_matches(cf_hashes.clone())

libium/src/upgrade/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub async fn get_version_groups() -> Result<&'static Vec<Vec<String>>> {
2929
if let Some(v) = VERSION_GROUPS.get() {
3030
Ok(v)
3131
} else {
32-
let versions = MODRINTH_API.list_game_versions().await?;
32+
let versions = MODRINTH_API.tag_list_game_versions().await?;
3333
let mut v = vec![vec![]];
3434
for version in versions {
3535
if version.version_type == GameVersionType::Release {

libium/src/upgrade/mod_downloadable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl Mod {
3838
Ok(try_from_cf_file(CURSEFORGE_API.get_mod_file(*mod_id, *pin).await?)?.1)
3939
}
4040
ModIdentifier::PinnedModrinthProject(_, pin) => {
41-
Ok(from_mr_version(MODRINTH_API.get_version(pin).await?).1)
41+
Ok(from_mr_version(MODRINTH_API.version_get(pin).await?).1)
4242
}
4343
ModIdentifier::PinnedGitHubRepository((owner, repo), pin) => Ok(from_gh_asset(
4444
GITHUB_API
@@ -58,7 +58,7 @@ impl Mod {
5858
.collect::<Result<Vec<_>>>()?
5959
}
6060
ModIdentifier::ModrinthProject(id) => MODRINTH_API
61-
.list_versions(id)
61+
.version_list(id)
6262
.await?
6363
.into_iter()
6464
.map(from_mr_version)

libium/src/upgrade/modpack_downloadable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl ModpackIdentifier {
2828
try_from_cf_file(CURSEFORGE_API.get_mod_files(*id).await?.swap_remove(0))?
2929
}
3030
ModpackIdentifier::ModrinthModpack(id) => {
31-
from_mr_version(MODRINTH_API.list_versions(id).await?.swap_remove(0))
31+
from_mr_version(MODRINTH_API.version_list(id).await?.swap_remove(0))
3232
}
3333
};
3434

src/subcommands/list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ pub async fn verbose(profile: &mut Profile, markdown: bool) -> Result<()> {
7474
vec![]
7575
} else {
7676
MODRINTH_API
77-
.get_multiple_projects(&mr_ids.iter().map(AsRef::as_ref).collect_vec())
77+
.project_get_multiple(&mr_ids.iter().map(AsRef::as_ref).collect_vec())
7878
.await?
7979
};
8080
let mr_teams_members = if mr_projects.is_empty() {
8181
vec![]
8282
} else {
8383
MODRINTH_API
84-
.list_multiple_teams_members(&mr_projects.iter().map(|p| p.team.as_ref()).collect_vec())
84+
.team_multiple_list_members(&mr_projects.iter().map(|p| p.team.as_ref()).collect_vec())
8585
.await?
8686
};
8787

0 commit comments

Comments
 (0)