mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-13 00:02:41 +10:00
* feat: add new template options, asahi support, and refactoring * feat: install dir scanning, validation fixes, progress fixes, download manager refactor This kind of ballooned out of scope, but I implemented some much needed fixes for the download manager. First off, I cleanup the Downloadable trait, there was some duplication of function. Second, I refactored the "validate" into the GameDownloadAgent, which calls a 'validate_chunk_logic' yada, same structure as downloading. Third, I fixed the progress and validation issues. Fourth, I added game scanning * feat: out of box support for Asahi Linux * fix: clippy * fix: don't break database
28 lines
986 B
Rust
28 lines
986 B
Rust
use std::sync::Arc;
|
|
|
|
use tauri::AppHandle;
|
|
|
|
use crate::{
|
|
database::models::data::DownloadableMetadata,
|
|
error::application_download_error::ApplicationDownloadError,
|
|
};
|
|
|
|
use super::{
|
|
download_manager_frontend::DownloadStatus,
|
|
util::{download_thread_control_flag::DownloadThreadControl, progress_object::ProgressObject},
|
|
};
|
|
|
|
pub trait Downloadable: Send + Sync {
|
|
fn download(&self, app_handle: &AppHandle) -> Result<bool, ApplicationDownloadError>;
|
|
fn validate(&self, app_handle: &AppHandle) -> Result<bool, ApplicationDownloadError>;
|
|
|
|
fn progress(&self) -> Arc<ProgressObject>;
|
|
fn control_flag(&self) -> DownloadThreadControl;
|
|
fn status(&self) -> DownloadStatus;
|
|
fn metadata(&self) -> DownloadableMetadata;
|
|
fn on_initialised(&self, app_handle: &AppHandle);
|
|
fn on_error(&self, app_handle: &AppHandle, error: &ApplicationDownloadError);
|
|
fn on_complete(&self, app_handle: &AppHandle);
|
|
fn on_cancelled(&self, app_handle: &AppHandle);
|
|
}
|