refactor(download manager): Fully separate & generic download manager

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2025-01-02 12:16:17 +11:00
parent 3d32501d81
commit a0cedf831b
15 changed files with 283 additions and 223 deletions
+3 -2
View File
@@ -27,6 +27,7 @@ use db::{
};
use download_manager::download_manager::DownloadManager;
use download_manager::download_manager_builder::DownloadManagerBuilder;
use download_manager::downloadable_metadata::DownloadableMetadata;
use debug::fetch_system_data;
use downloads::download_commands::*;
use http::Response;
@@ -81,7 +82,7 @@ pub struct User {
pub struct AppState<'a> {
status: AppStatus,
user: Option<User>,
games: HashMap<String, Game>,
games: HashMap<DownloadableMetadata, Game>,
#[serde(skip_serializing)]
download_manager: Arc<DownloadManager>,
@@ -181,7 +182,7 @@ fn setup(handle: AppHandle) -> AppState<'static> {
db_handle
.applications
.statuses
.entry(game_id.to_string())
.entry(game_id)
.and_modify(|v| *v = ApplicationStatus::Remote {});
}
drop(db_handle);