mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-02-16 15:22:01 +03:00
feat(core): removed launcher.speed_limit
config
This commit is contained in:
parent
ec1d3aee7c
commit
ac652529d8
7 changed files with 8 additions and 19 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -76,7 +76,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anime-launcher-sdk"
|
||||
version = "0.5.6"
|
||||
version = "0.5.7"
|
||||
dependencies = [
|
||||
"anime-game-core",
|
||||
"anyhow",
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c64787bf8afca33eff7f5d450763bd655ac2ef72
|
||||
Subproject commit f84ad39d86fe436678f2ceedf0861609d54bfd6d
|
|
@ -151,10 +151,6 @@ impl SimpleAsyncComponent for ComponentVersion {
|
|||
installer.set_temp_folder(temp);
|
||||
}
|
||||
|
||||
installer.downloader
|
||||
.set_downloading_speed(config.launcher.speed_limit)
|
||||
.expect("Failed to set downloading speed limit");
|
||||
|
||||
self.state = VersionState::Downloading;
|
||||
|
||||
let progress_bar_sender = self.progress_bar.sender().clone();
|
||||
|
|
|
@ -16,11 +16,9 @@ use crate::ui::components::*;
|
|||
use crate::i18n::*;
|
||||
use crate::*;
|
||||
|
||||
fn get_installer(uri: &str, temp: Option<&PathBuf>, speed_limit: u64) -> anyhow::Result<Installer> {
|
||||
fn get_installer(uri: &str, temp: Option<&PathBuf>) -> anyhow::Result<Installer> {
|
||||
let mut installer = Installer::new(uri)?;
|
||||
|
||||
installer.downloader.set_downloading_speed(speed_limit)?;
|
||||
|
||||
if let Some(temp) = temp {
|
||||
installer.set_temp_folder(temp);
|
||||
}
|
||||
|
@ -374,7 +372,7 @@ impl SimpleAsyncComponent for DownloadComponentsApp {
|
|||
tracing::info!("Installing wine: {}", wine.name);
|
||||
|
||||
// Install wine
|
||||
match get_installer(&wine.uri, config.launcher.temp.as_ref(), config.launcher.speed_limit) {
|
||||
match get_installer(&wine.uri, config.launcher.temp.as_ref()) {
|
||||
Ok(mut installer) => {
|
||||
// Create wine builds folder
|
||||
if config.game.wine.builds.exists() {
|
||||
|
@ -495,7 +493,7 @@ impl SimpleAsyncComponent for DownloadComponentsApp {
|
|||
// Install DXVK
|
||||
tracing::info!("Installing DXVK: {}", dxvk.name);
|
||||
|
||||
match get_installer(&dxvk.uri, config.launcher.temp.as_ref(), config.launcher.speed_limit) {
|
||||
match get_installer(&dxvk.uri, config.launcher.temp.as_ref()) {
|
||||
Ok(mut installer) => {
|
||||
let progress_bar_input = progress_bar_input.clone();
|
||||
let sender = sender.clone();
|
||||
|
|
|
@ -16,7 +16,6 @@ use super::{App, AppMsg};
|
|||
pub fn download_diff(sender: ComponentSender<App>, progress_bar_input: Sender<ProgressBarMsg>, diff: VersionDiff) {
|
||||
sender.input(AppMsg::SetDownloading(true));
|
||||
|
||||
// TODO: add speed limit
|
||||
std::thread::spawn(move || {
|
||||
let config = config::get().unwrap();
|
||||
|
||||
|
|
|
@ -52,10 +52,6 @@ pub fn download_wine(sender: ComponentSender<App>, progress_bar_input: Sender<Pr
|
|||
installer.temp_folder = temp_folder.to_path_buf();
|
||||
}
|
||||
|
||||
installer.downloader
|
||||
.set_downloading_speed(config.launcher.speed_limit)
|
||||
.expect("Failed to set downloading speed limit");
|
||||
|
||||
sender.input(AppMsg::SetDownloading(true));
|
||||
|
||||
std::thread::spawn(clone!(@strong sender => move || {
|
||||
|
|
|
@ -923,15 +923,15 @@ impl SimpleAsyncComponent for GeneralApp {
|
|||
|
||||
self.selected_dxvk_version = if let Ok(Some(selected)) = CONFIG.get_selected_dxvk() {
|
||||
let mut index = 0;
|
||||
|
||||
|
||||
for (i, version) in self.downloaded_dxvk_versions.iter().enumerate() {
|
||||
if version.name == selected.name {
|
||||
index = i;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
index as u32
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue