mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 00:31:33 +10:00
feat(downloads): Generic function to set download state
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@ -135,6 +135,16 @@ pub async fn resume_game_download(
|
||||
|
||||
Ok(())
|
||||
}
|
||||
#[tauri::command]
|
||||
pub async fn set_download_state(
|
||||
state: tauri::State<'_, Mutex<AppState>>,
|
||||
game_id: String,
|
||||
status: GameDownloadState
|
||||
) -> Result<(), String> {
|
||||
get_game_download(state, game_id).change_state(status);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_game_download(
|
||||
state: tauri::State<'_, Mutex<AppState>>,
|
||||
|
||||
@ -12,7 +12,6 @@ use std::{
|
||||
path::PathBuf,
|
||||
sync::{Arc, RwLock},
|
||||
thread::sleep,
|
||||
time::Duration,
|
||||
};
|
||||
use urlencoding::encode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user