Some checks are pending
Release Multiplatform Binaries / build (deb,appimage, linux-x86_64, ubuntu-22.04, x86_64-unknown-linux-gnu) (push) Waiting to run
Release Multiplatform Binaries / build (dmg,app, macos-arm64, macos-14, aarch64-apple-darwin) (push) Waiting to run
Release Multiplatform Binaries / build (dmg,app, macos-x86_64, macos-14, x86_64-apple-darwin) (push) Waiting to run
Release Multiplatform Binaries / build (nsis, windows-x86_64, windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Release Multiplatform Binaries / create-release (push) Blocked by required conditions
- Rebased onto official Polyfrost OneLauncher v2.3.1 (commit 0e49c691)
- Preserved 100% offline authentication without requiring Microsoft accounts
- Integrated custom 3D offline skin changer with UUID character slot targeting
- Maintained CustomSkinLoader auto-configuration for Ely.by and SkinRestorer
- Maintained direct GitHub Releases auto-updater pointing to oiupoyt/OneLauncher-Cracked
- Maintained mods filter popover fix eliminating text ghosting/duplication
- Configured dev profile to prevent debug symbol bloat
57 lines
1.6 KiB
Rust
57 lines
1.6 KiB
Rust
|
|
use std::env;
|
|
|
|
use oneclient_common::domain::{ContentType, ProviderId};
|
|
use oneclient_content::packages::types::SearchFilters;
|
|
use oneclient_core::{LauncherResult, dev, logger};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> LauncherResult<()> {
|
|
logger::init_debug()?;
|
|
|
|
let mut args = env::args().skip(1);
|
|
let provider_name = args.next().unwrap_or_else(|| "modrinth".into());
|
|
let query = args.next().unwrap_or_else(|| "sodium".into());
|
|
|
|
let provider_id = parse_provider(&provider_name)?;
|
|
let env = dev::ephemeral_services().await?.content();
|
|
let provider = env.providers.get(provider_id)?;
|
|
|
|
let page = provider
|
|
.search(
|
|
&SearchFilters {
|
|
query: Some(query.clone()),
|
|
limit: Some(8),
|
|
content_type: Some(ContentType::Mod),
|
|
..Default::default()
|
|
},
|
|
&env,
|
|
)
|
|
.await?;
|
|
|
|
println!(
|
|
"Search {:?} for {query:?} - {} hit(s) (showing {}):\n",
|
|
provider_id,
|
|
page.total,
|
|
page.items.len()
|
|
);
|
|
|
|
for hit in &page.items {
|
|
println!(
|
|
" {} ({}) - {} downloads\n {}",
|
|
hit.name, hit.id, hit.downloads, hit.summary
|
|
);
|
|
}
|
|
|
|
Ok(())
|
|
}
|
|
|
|
fn parse_provider(name: &str) -> LauncherResult<ProviderId> {
|
|
match name.to_lowercase().as_str() {
|
|
"modrinth" | "mr" => Ok(ProviderId::Modrinth),
|
|
"curseforge" | "cf" => Ok(ProviderId::CurseForge),
|
|
other => Err(oneclient_core::LauncherError::InvalidSettingsProfile {
|
|
reason: format!("unknown provider {other:?}; use modrinth or curseforge"),
|
|
}),
|
|
}
|
|
}
|