In-app store, delta version support (#179)
* fix: windows launch * feat: add necessary client fixes for store * fix: keyring fix * feat: delta version support * feat: dl/disk progress * feat: move to jwt auth * fix: lint
This commit is contained in:
@@ -2,8 +2,8 @@ use std::sync::nonpoison::Mutex;
|
||||
|
||||
use bitcode::{Decode, Encode};
|
||||
use database::{
|
||||
DownloadableMetadata, GameDownloadStatus, borrow_db_checked,
|
||||
borrow_db_mut_checked, platform::Platform,
|
||||
DownloadableMetadata, GameDownloadStatus, borrow_db_checked, borrow_db_mut_checked,
|
||||
platform::Platform,
|
||||
};
|
||||
use games::{
|
||||
collections::collection::Collection,
|
||||
@@ -190,7 +190,6 @@ pub async fn fetch_game_logic(
|
||||
let db_lock = borrow_db_checked();
|
||||
|
||||
let metadata_option = db_lock.applications.installed_game_version.get(&id);
|
||||
|
||||
|
||||
match metadata_option {
|
||||
None => None,
|
||||
@@ -258,7 +257,7 @@ struct VersionDownloadOptionRequiredContent {
|
||||
name: String,
|
||||
icon_object_id: String,
|
||||
short_description: String,
|
||||
size: usize,
|
||||
size: GameSize,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
@@ -268,9 +267,15 @@ pub struct VersionDownloadOption {
|
||||
display_name: Option<String>,
|
||||
version_path: String,
|
||||
platform: Platform,
|
||||
size: usize,
|
||||
size: GameSize,
|
||||
required_content: Vec<VersionDownloadOptionRequiredContent>,
|
||||
}
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GameSize {
|
||||
install_size: usize,
|
||||
download_size: usize,
|
||||
}
|
||||
|
||||
pub async fn fetch_game_version_options_logic(
|
||||
game_id: String,
|
||||
@@ -278,7 +283,7 @@ pub async fn fetch_game_version_options_logic(
|
||||
) -> Result<Vec<VersionDownloadOption>, RemoteAccessError> {
|
||||
let client = DROP_CLIENT_ASYNC.clone();
|
||||
|
||||
let response = generate_url(&["/api/v1/client/game/versions"], &[("id", &game_id)])?;
|
||||
let response = generate_url(&["/api/v1/client/game", &game_id, "versions"], &[])?;
|
||||
let response = client
|
||||
.get(response)
|
||||
.header("Authorization", generate_authorization_header())
|
||||
|
||||
@@ -73,7 +73,7 @@ async fn setup(handle: AppHandle) -> AppState {
|
||||
|
||||
let console = ConsoleAppender::builder()
|
||||
.encoder(Box::new(PatternEncoder::new(
|
||||
"{d} | {l} | {f}:{L} - {m}{n}",
|
||||
"{d} | {h({l})} | {f}:{L} - {m}{n}",
|
||||
)))
|
||||
.build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user