Removed gxhash and ran cargo fmt

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-11-01 07:51:56 +11:00
parent 86363327a3
commit bd39f1fd72
15 changed files with 129 additions and 104 deletions

View File

@ -1,27 +1,30 @@
mod auth;
mod db;
mod downloads;
mod library;
mod remote;
mod downloads;
#[cfg(test)]
mod tests;
use crate::db::DatabaseImpls;
use crate::downloads::download_agent::GameDownloadAgent;
use auth::{auth_initiate, generate_authorization_header, recieve_handshake};
use db::{DatabaseInterface, DATA_ROOT_DIR};
use downloads::download_commands::{queue_game_download, start_game_downloads, stop_specific_game_download};
use downloads::download_commands::{
queue_game_download, start_game_downloads, stop_specific_game_download,
};
use env_logger::Env;
use http::{header::*, response::Builder as ResponseBuilder};
use library::{fetch_game, fetch_library, Game};
use log::info;
use remote::{gen_drop_url, use_remote};
use serde::{Deserialize, Serialize};
use std::{
collections::HashMap, sync::{LazyLock, Mutex}
};
use std::sync::Arc;
use std::{
collections::HashMap,
sync::{LazyLock, Mutex},
};
use tauri_plugin_deep_link::DeepLinkExt;
use crate::db::DatabaseImpls;
use crate::downloads::download_agent::{GameDownloadAgent};
#[derive(Clone, Copy, Serialize)]
pub enum AppStatus {
@ -31,7 +34,7 @@ pub enum AppStatus {
SignedInNeedsReauth,
}
#[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all="camelCase")]
#[serde(rename_all = "camelCase")]
pub struct User {
id: String,
username: String,
@ -41,14 +44,14 @@ pub struct User {
}
#[derive(Clone, Serialize)]
#[serde(rename_all="camelCase")]
#[serde(rename_all = "camelCase")]
pub struct AppState {
status: AppStatus,
user: Option<User>,
games: HashMap<String, Game>,
#[serde(skip_serializing)]
game_downloads: HashMap<String, Arc<GameDownloadAgent>>
game_downloads: HashMap<String, Arc<GameDownloadAgent>>,
}
#[tauri::command]
@ -144,7 +147,9 @@ pub fn run() {
info!("handling drop:// url");
let binding = event.urls();
let url = binding.first().unwrap();
if url.host_str().unwrap() == "handshake" { recieve_handshake(handle.clone(), url.path().to_string()) }
if url.host_str().unwrap() == "handshake" {
recieve_handshake(handle.clone(), url.path().to_string())
}
});
Ok(())