diff options
Diffstat (limited to 'src/commands/modification.rs')
-rw-r--r-- | src/commands/modification.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/commands/modification.rs b/src/commands/modification.rs index ffc4e10..67cde0b 100644 --- a/src/commands/modification.rs +++ b/src/commands/modification.rs | |||
@@ -159,16 +159,20 @@ async fn get_mod_infos(config: Cfg, mod_ids: Vec<String>, list: List) -> MLE<Vec | |||
159 | .find(|v| v.id == current_id) | 159 | .find(|v| v.id == current_id) |
160 | .unwrap(), | 160 | .unwrap(), |
161 | ); | 161 | ); |
162 | 162 | ||
163 | file = current_version | 163 | // match primary, if none? |
164 | let files = current_version | ||
164 | .clone() | 165 | .clone() |
165 | .ok_or("") | 166 | .ok_or("") |
166 | .unwrap() | 167 | .unwrap() |
167 | .files | 168 | .files; |
168 | .into_iter() | 169 | |
169 | .find(|f| f.primary) | 170 | file = match files.clone().into_iter().find(|f| f.primary) { |
170 | .unwrap() | 171 | Some(f) => f, |
172 | None => { files[0].clone() } | ||
173 | } | ||
171 | .url; | 174 | .url; |
175 | |||
172 | for ver in available_versions { | 176 | for ver in available_versions { |
173 | available_versions_vec.push(ver.id); | 177 | available_versions_vec.push(ver.id); |
174 | } | 178 | } |