mirror of
https://github.com/an-anime-team/sleepy-launcher.git
synced 2025-02-17 02:09:46 +03:00
feat(core): added speed limit applying for components downloading
Forgot to implement use of `set_downloading_speed` for components downloading. Limitation is gathered from the `config.json` file
This commit is contained in:
parent
cd3614df83
commit
4bdce19063
1 changed files with 6 additions and 1 deletions
|
@ -144,12 +144,17 @@ impl SimpleAsyncComponent for ComponentVersion {
|
|||
VersionState::NotDownloaded => {
|
||||
if let Ok(config) = config::get() {
|
||||
// todo
|
||||
let mut installer = Installer::new(&self.download_uri).expect("Failed to create installer instance for this version");
|
||||
let mut installer = Installer::new(&self.download_uri)
|
||||
.expect("Failed to create installer instance for this version");
|
||||
|
||||
if let Some(temp) = config.launcher.temp {
|
||||
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();
|
||||
|
|
Loading…
Add table
Reference in a new issue