2023-04-17 14:05:27 -07:00
|
|
|
use crate::api::Result;
|
|
|
|
|
use daedalus::minecraft::VersionManifest;
|
|
|
|
|
use daedalus::modded::Manifest;
|
|
|
|
|
|
2023-06-28 09:58:58 -07:00
|
|
|
pub fn init<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {
|
|
|
|
|
tauri::plugin::Builder::new("metadata")
|
|
|
|
|
.invoke_handler(tauri::generate_handler![
|
|
|
|
|
metadata_get_game_versions,
|
2024-07-24 11:03:19 -07:00
|
|
|
metadata_get_loader_versions,
|
2023-06-28 09:58:58 -07:00
|
|
|
])
|
|
|
|
|
.build()
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-17 14:05:27 -07:00
|
|
|
/// Gets the game versions from daedalus
|
|
|
|
|
#[tauri::command]
|
|
|
|
|
pub async fn metadata_get_game_versions() -> Result<VersionManifest> {
|
|
|
|
|
Ok(theseus::metadata::get_minecraft_versions().await?)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Gets the fabric versions from daedalus
|
|
|
|
|
#[tauri::command]
|
2024-07-24 11:03:19 -07:00
|
|
|
pub async fn metadata_get_loader_versions(loader: &str) -> Result<Manifest> {
|
|
|
|
|
Ok(theseus::metadata::get_loader_versions(loader).await?)
|
2023-08-21 17:39:39 -04:00
|
|
|
}
|