fix: fix other metadata endpoints

This commit is contained in:
DecDuck
2025-01-19 16:15:43 +11:00
parent 3776e1e9d4
commit faf87da3c7
3 changed files with 5 additions and 7 deletions
+1
View File
@@ -306,6 +306,7 @@ async function installFlow() {
versionOptions.value = await invoke("fetch_game_verion_options", {
gameId: game.value.id,
});
console.log(versionOptions.value);
installDirs.value = await invoke("fetch_download_dir_stats");
} catch (error) {
installError.value = (error as string).toString();
@@ -136,7 +136,7 @@ impl GameDownloadAgent {
let manifest_url = base_url
.join(
format!(
"/api/v1/client/game/manifest?id={}&version={}",
"/api/v1/client/metadata/manifest?id={}&version={}",
self.id,
encode(&self.version)
)
@@ -308,7 +308,6 @@ impl GameDownloadAgent {
sender.send(DownloadManagerSignal::Error(e)).unwrap();
}
}
info!("Completed context id {}", index);
});
}
});
+3 -5
View File
@@ -180,7 +180,7 @@ pub fn fetch_game_verion_options_logic(
) -> Result<Vec<GameVersionOption>, RemoteAccessError> {
let client = reqwest::blocking::Client::new();
let response = make_request(&client, &["/api/v1/client/game/versions"], &[("id", &game_id)], |r| {
let response = make_request(&client, &["/api/v1/client/metadata/versions"], &[("id", &game_id)], |r| {
r.header("Authorization", generate_authorization_header())
})?.send()?;
@@ -189,10 +189,8 @@ pub fn fetch_game_verion_options_logic(
warn!("{:?}", err);
return Err(RemoteAccessError::InvalidResponse(err));
}
let text = response.text().unwrap();
println!("JSON Text: {}", text);
let data: Vec<GameVersionOption> = serde_json::from_str(&text).unwrap();
let data: Vec<GameVersionOption> = response.json()?;
let state_lock = state.lock().unwrap();
let process_manager_lock = state_lock.process_manager.lock().unwrap();
@@ -295,7 +293,7 @@ pub fn on_game_complete(
let endpoint = base_url.join(
format!(
"/api/v1/client/game/version?id={}&version={}",
"/api/v1/client/metadata/version?id={}&version={}",
meta.id,
encode(meta.version.as_ref().unwrap())
)