summaryrefslogtreecommitdiff
path: root/src/commands/update.rs
diff options
context:
space:
mode:
authorfx <[email protected]>2023-05-13 17:28:00 +0200
committerfx <[email protected]>2023-05-13 17:28:00 +0200
commit5a2ea0755b29a8811aeeec1c73679c5783082628 (patch)
treedb2aaedda9678465763993eeec15bd20673394e8 /src/commands/update.rs
parent9063a041f6b2e72f6e4a861c77ac16065dd5378b (diff)
parent3b9d717ecd61bd2b5c32ec117f38c7d67a109748 (diff)
downloadmodlist-5a2ea0755b29a8811aeeec1c73679c5783082628.tar
modlist-5a2ea0755b29a8811aeeec1c73679c5783082628.tar.gz
modlist-5a2ea0755b29a8811aeeec1c73679c5783082628.zip
Merge pull request 'todos' (#5) from todos into master
Reviewed-on: http://raspberrypi.fritz.box:7920/fx/modlist/pulls/5
Diffstat (limited to 'src/commands/update.rs')
-rw-r--r--src/commands/update.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/commands/update.rs b/src/commands/update.rs
index d76ba4b..d3a282b 100644
--- a/src/commands/update.rs
+++ b/src/commands/update.rs
@@ -19,7 +19,7 @@ pub async fn update(
19) -> MLE<()> { 19) -> MLE<()> {
20 for current_list in liststack { 20 for current_list in liststack {
21 println!("Update mods in {}", current_list.id); 21 println!("Update mods in {}", current_list.id);
22 let mods = userlist_get_all_ids(config.clone(), current_list.clone().id)?; 22 let mods = userlist_get_all_ids(config.clone(), &current_list.id)?;
23 23
24 let mut current_versions: Vec<(String, String)> = vec![]; 24 let mut current_versions: Vec<(String, String)> = vec![];
25 25
@@ -27,10 +27,10 @@ pub async fn update(
27 27
28 for id in mods { 28 for id in mods {
29 let info = mods_get_info(config.clone(), &id)?; 29 let info = mods_get_info(config.clone(), &id)?;
30 println!(" �{}", info.title); 30 println!(" �{}", info.title);
31 31
32 if userlist_get_set_version(config.clone(), &current_list.id, &id)? { 32 if userlist_get_set_version(config.clone(), &current_list.id, &id)? {
33 println!(" └Set version, skipping update"); 33 println!(" └Set version, skipping update");
34 continue; 34 continue;
35 } 35 }
36 36
@@ -54,7 +54,7 @@ pub async fn update(
54 Err(e) => { 54 Err(e) => {
55 if e.to_string() == "Mod: NO_UPDATE_AVAILABLE" { 55 if e.to_string() == "Mod: NO_UPDATE_AVAILABLE" {
56 println!( 56 println!(
57 " └No new version found for the specified minecraft version" 57 " └No new version found for the specified minecraft version"
58 ); 58 );
59 } else { 59 } else {
60 return Err(e); 60 return Err(e);
@@ -105,7 +105,6 @@ async fn specific_update(config: Cfg, clean: bool, list: List, id: String) -> ML
105 } 105 }
106 106
107 let mut current: Vec<Version> = vec![]; 107 let mut current: Vec<Version> = vec![];
108 //TODO Split clean and no match
109 if clean 108 if clean
110 || (versions.join("|") 109 || (versions.join("|")
111 != userlist_get_applicable_versions( 110 != userlist_get_applicable_versions(
@@ -134,7 +133,6 @@ async fn specific_update(config: Cfg, clean: bool, list: List, id: String) -> ML
134 }?; 133 }?;
135 current.push(current_ver.clone()); 134 current.push(current_ver.clone());
136 135
137 //TODO implement version selection if no primary
138 let link = match current_ver 136 let link = match current_ver
139 .files 137 .files
140 .into_iter() 138 .into_iter()