refactor(download manager): rename files to what they contain

This commit is contained in:
DecDuck
2024-11-26 19:54:43 +11:00
parent e08a2b20f3
commit 12b15aa0fd
8 changed files with 398 additions and 366 deletions
+15
View File
@@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
use serde_json::json;
use tauri::{AppHandle, Manager};
use crate::db;
use crate::db::DatabaseGameStatus;
use crate::db::DatabaseImpls;
use crate::remote::RemoteAccessError;
@@ -109,3 +110,17 @@ pub fn fetch_game(id: String, app: tauri::AppHandle) -> Result<String, String> {
Ok(result.unwrap())
}
#[tauri::command]
pub fn fetch_game_status(id: String) -> Result<DatabaseGameStatus, String> {
let db_handle = DB.borrow_data().unwrap();
let status = db_handle
.games
.games_statuses
.get(&id)
.unwrap_or(&DatabaseGameStatus::Remote)
.clone();
drop(db_handle);
return Ok(status);
}