diff options
author | fxqnlr <[email protected]> | 2023-05-25 21:06:40 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-05-25 21:06:40 +0200 |
commit | 7f1a262999d7a8b7f12a97daf4b6722638dc62a1 (patch) | |
tree | c030a952891fba2f64427adad1113efc567ae54d /src/commands/download.rs | |
parent | 48393b209396db9ddd44251b2bb445d3ad7533fb (diff) | |
download | modlist-7f1a262999d7a8b7f12a97daf4b6722638dc62a1.tar modlist-7f1a262999d7a8b7f12a97daf4b6722638dc62a1.tar.gz modlist-7f1a262999d7a8b7f12a97daf4b6722638dc62a1.zip |
more progress instead of print, more references
Diffstat (limited to 'src/commands/download.rs')
-rw-r--r-- | src/commands/download.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/commands/download.rs b/src/commands/download.rs index fea3f34..e9a96b5 100644 --- a/src/commands/download.rs +++ b/src/commands/download.rs | |||
@@ -1,4 +1,6 @@ | |||
1 | 1 | ||
2 | use indicatif::MultiProgress; | ||
3 | |||
2 | use crate::{config::Cfg, List}; | 4 | use crate::{config::Cfg, List}; |
3 | use crate::{ | 5 | use crate::{ |
4 | db::userlist_get_all_current_versions_with_mods, | 6 | db::userlist_get_all_current_versions_with_mods, |
@@ -10,10 +12,12 @@ use crate::{ | |||
10 | }; | 12 | }; |
11 | 13 | ||
12 | pub async fn download(config: &Cfg, liststack: Vec<List>, clean: bool, delete_old: bool) -> MLE<()> { | 14 | pub async fn download(config: &Cfg, liststack: Vec<List>, clean: bool, delete_old: bool) -> MLE<()> { |
15 | |||
16 | let mp = MultiProgress::new(); | ||
17 | |||
13 | for current_list in liststack { | 18 | for current_list in liststack { |
14 | println!("Downloading current versions of mods in {}", current_list.id); | 19 | println!("Downloading current versions of mods in {}", current_list.id); |
15 | let downloaded_versions = get_downloaded_versions(current_list.clone())?; | 20 | let downloaded_versions = get_downloaded_versions(current_list.clone())?; |
16 | // println!("To download: {:#?}", downloaded_versions); | ||
17 | let current_version_ids = match userlist_get_all_current_versions_with_mods( | 21 | let current_version_ids = match userlist_get_all_current_versions_with_mods( |
18 | config, | 22 | config, |
19 | String::from(¤t_list.id), | 23 | String::from(¤t_list.id), |
@@ -54,6 +58,8 @@ pub async fn download(config: &Cfg, liststack: Vec<List>, clean: bool, delete_ol | |||
54 | current_list.clone(), | 58 | current_list.clone(), |
55 | config.clone(), | 59 | config.clone(), |
56 | get_raw_versions(&config.apis.modrinth, to_download).await, | 60 | get_raw_versions(&config.apis.modrinth, to_download).await, |
61 | &mp, | ||
62 | None | ||
57 | ) | 63 | ) |
58 | .await?; | 64 | .await?; |
59 | } else { | 65 | } else { |