summaryrefslogtreecommitdiff
path: root/src/files.rs
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2023-01-29 14:13:06 +0100
committerFxQnLr <[email protected]>2023-01-29 14:13:06 +0100
commitd7d0c904bff665ab5c8355f2381a0628ebbf7a30 (patch)
tree68a63f39a5bf6241e4ca9499d03ea148ec9737c4 /src/files.rs
parentc51647f527b43e7109d6922e07c6c1daa5501819 (diff)
parent54752f7eb39e20929a7816c90be33bf8dbff2a6c (diff)
downloadmodlist-d7d0c904bff665ab5c8355f2381a0628ebbf7a30.tar
modlist-d7d0c904bff665ab5c8355f2381a0628ebbf7a30.tar.gz
modlist-d7d0c904bff665ab5c8355f2381a0628ebbf7a30.zip
Merge branch 'new_input' of https://github.com/FxQnLr/modlist into new_input
Diffstat (limited to 'src/files.rs')
-rw-r--r--src/files.rs3
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