diff --git a/pages/library/[id]/index.vue b/pages/library/[id]/index.vue index d2a91f2..7bb7fa8 100644 --- a/pages/library/[id]/index.vue +++ b/pages/library/[id]/index.vue @@ -32,7 +32,7 @@ @uninstall="() => uninstall()" @kill="() => kill()" @options="() => (configureModalOpen = true)" - @resume="() => console.log('resume')" + @resume="() => resumeDownload()" :status="status" /> >, ) -> Result<(), DownloadManagerError> { + let s = borrow_db_checked().applications.game_statuses.get(&game_id).unwrap().clone(); + + let (version_name, install_dir) = match s { + GameDownloadStatus::Remote { } => unreachable!(), + GameDownloadStatus::SetupRequired { .. } => unreachable!(), + GameDownloadStatus::Installed { .. } => unreachable!(), + GameDownloadStatus::PartiallyInstalled { version_name, install_dir } => (version_name, install_dir), + }; let sender = state.lock().unwrap().download_manager.get_sender(); + let parent_dir: PathBuf = install_dir.into(); let game_download_agent = Arc::new(Box::new(GameDownloadAgent::new( - game_id, version, install_dir.into(), sender + game_id, version_name.clone(), parent_dir.parent().unwrap().to_path_buf(), sender )) as Box); Ok(state.lock().unwrap().download_manager.queue_download(game_download_agent)?) - }