From 9063a041f6b2e72f6e4a861c77ac16065dd5378b Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Tue, 9 May 2023 20:34:09 +0200 Subject: add list toggles to update and download; add mod remove output and fix errors --- src/commands/download.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/commands/download.rs') diff --git a/src/commands/download.rs b/src/commands/download.rs index 1a8eb8f..ebfb4eb 100644 --- a/src/commands/download.rs +++ b/src/commands/download.rs @@ -1,6 +1,6 @@ -use crate::{config::Cfg, get_current_list, List}; +use crate::{config::Cfg, List}; use crate::{ - db::{lists_get, lists_get_all_ids, userlist_get_all_current_versions_with_mods}, + db::userlist_get_all_current_versions_with_mods, error::{ErrorType, MLError, MLE}, files::{ clean_list_dir, delete_version, disable_version, download_versions, get_downloaded_versions, @@ -8,20 +8,10 @@ use crate::{ modrinth::get_raw_versions, }; -pub async fn download(config: Cfg, all_lists: bool, clean: bool, delete_old: bool) -> MLE<()> { - let mut liststack: Vec = vec![]; - if all_lists { - let list_ids = lists_get_all_ids(config.clone())?; - for id in list_ids { - liststack.push(lists_get(config.clone(), id)?); - } - } else { - let current = get_current_list(config.clone())?; - println!("Downloading current versions of mods in {}", current.id); - liststack.push(current) - } +pub async fn download(config: Cfg, liststack: Vec, clean: bool, delete_old: bool) -> MLE<()> { for current_list in liststack { + println!("Downloading current versions of mods in {}", current_list.id); let downloaded_versions = get_downloaded_versions(current_list.clone())?; // println!("To download: {:#?}", downloaded_versions); let current_version_ids = match userlist_get_all_current_versions_with_mods( -- cgit v1.2.3