diff options
author | fxqnlr <[email protected]> | 2023-01-29 13:56:06 +0100 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-01-29 13:56:06 +0100 |
commit | 54752f7eb39e20929a7816c90be33bf8dbff2a6c (patch) | |
tree | 1b2f6d22733c380b0bb6f5a1e9227dc2082da49f /src/files.rs | |
parent | 57ab6addda10a49c18dc09208dfb319c0205e869 (diff) | |
download | modlist-54752f7eb39e20929a7816c90be33bf8dbff2a6c.tar modlist-54752f7eb39e20929a7816c90be33bf8dbff2a6c.tar.gz modlist-54752f7eb39e20929a7816c90be33bf8dbff2a6c.zip |
fixed not downloading on mod add
Diffstat (limited to 'src/files.rs')
-rw-r--r-- | src/files.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/files.rs b/src/files.rs index ecb6e3e..8c822b2 100644 --- a/src/files.rs +++ b/src/files.rs | |||
@@ -13,6 +13,7 @@ pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) | |||
13 | for ver in versions { | 13 | for ver in versions { |
14 | let project_name = mods_get_name(config.clone(), &ver.project_id)?; | 14 | let project_name = mods_get_name(config.clone(), &ver.project_id)?; |
15 | print!("\t({})Download version {}", project_name, ver.id); | 15 | print!("\t({})Download version {}", project_name, ver.id); |
16 | //Force flush of stdout, else print! doesn't print instantly | ||
16 | std::io::stdout().flush().unwrap(); | 17 | std::io::stdout().flush().unwrap(); |
17 | let primary_file = ver.files.into_iter().find(|file| file.primary).unwrap(); | 18 | let primary_file = ver.files.into_iter().find(|file| file.primary).unwrap(); |
18 | let mut splitname: Vec<&str> = primary_file.filename.split('.').collect(); | 19 | let mut splitname: Vec<&str> = primary_file.filename.split('.').collect(); |
@@ -22,7 +23,7 @@ pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) | |||
22 | }; | 23 | }; |
23 | let filename = format!("{}.mr.{}.{}.{}", splitname.join("."), ver.project_id, ver.id, extension); | 24 | let filename = format!("{}.mr.{}.{}.{}", splitname.join("."), ver.project_id, ver.id, extension); |
24 | download_file(primary_file.url, list.clone().download_folder, filename).await?; | 25 | download_file(primary_file.url, list.clone().download_folder, filename).await?; |
25 | tokio::time::sleep(std::time::Duration::new(3, 0)).await; | 26 | //tokio::time::sleep(std::time::Duration::new(3, 0)).await; |
26 | println!(" ✓"); | 27 | println!(" ✓"); |
27 | } | 28 | } |
28 | 29 | ||