mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-26 01:34:38 +10:00
refactor(download manager): rename files to what they contain
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user