From 54752f7eb39e20929a7816c90be33bf8dbff2a6c Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sun, 29 Jan 2023 13:56:06 +0100 Subject: fixed not downloading on mod add --- src/files.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/files.rs') 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) for ver in versions { let project_name = mods_get_name(config.clone(), &ver.project_id)?; print!("\t({})Download version {}", project_name, ver.id); + //Force flush of stdout, else print! doesn't print instantly std::io::stdout().flush().unwrap(); let primary_file = ver.files.into_iter().find(|file| file.primary).unwrap(); 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) }; let filename = format!("{}.mr.{}.{}.{}", splitname.join("."), ver.project_id, ver.id, extension); download_file(primary_file.url, list.clone().download_folder, filename).await?; - tokio::time::sleep(std::time::Duration::new(3, 0)).await; + //tokio::time::sleep(std::time::Duration::new(3, 0)).await; println!(" ✓"); } -- cgit v1.2.3