diff options
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 | ||