feat(download manager): only allow downloads for supported platforms

This commit is contained in:
DecDuck
2024-12-15 16:15:11 +11:00
parent 52436942eb
commit 269dcbb6f3
11 changed files with 107 additions and 59 deletions

View File

@ -37,6 +37,8 @@ pub enum DownloadManagerSignal {
Error(GameDownloadError),
/// Pushes UI update
Update,
/// Causes the Download Agent status to be synced to disk
Sync(usize),
}
pub enum DownloadManagerStatus {
Downloading,

View File

@ -141,6 +141,8 @@ impl DownloadManagerBuilder {
self.app_handle.emit("update_queue", event_data).unwrap();
}
fn sync_download_agent(&self) {}
fn remove_and_cleanup_game(&mut self, game_id: &String) -> Arc<GameDownloadAgent> {
self.download_queue.pop_front();
let download_agent = self.download_agent_registry.remove(game_id).unwrap();
@ -195,6 +197,9 @@ impl DownloadManagerBuilder {
DownloadManagerSignal::Update => {
self.push_manager_update();
}
DownloadManagerSignal::Sync(index) => {
self.sync_download_agent();
}
};
}
}