diff options
author | fxqnlr <[email protected]> | 2023-02-19 11:49:23 +0100 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-02-19 11:49:23 +0100 |
commit | 9c984cef9a2d0fb223635617934959480e8ca2df (patch) | |
tree | 4e9bcae11b2f028822591ea2948e311dded2de10 /src/files.rs | |
parent | ff23a11e632812b685f594324e6004c6da81cd4d (diff) | |
download | modlist-9c984cef9a2d0fb223635617934959480e8ca2df.tar modlist-9c984cef9a2d0fb223635617934959480e8ca2df.tar.gz modlist-9c984cef9a2d0fb223635617934959480e8ca2df.zip |
Added adding of specific mod-version
Diffstat (limited to 'src/files.rs')
-rw-r--r-- | src/files.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/files.rs b/src/files.rs index b9325ea..6519c6a 100644 --- a/src/files.rs +++ b/src/files.rs | |||
@@ -2,7 +2,7 @@ use std::{fs::{File, read_dir, remove_file, rename}, io::Write, collections::Has | |||
2 | use futures_util::StreamExt; | 2 | use futures_util::StreamExt; |
3 | use reqwest::Client; | 3 | use reqwest::Client; |
4 | 4 | ||
5 | use crate::{List, modrinth::Version, db::{userlist_add_disabled_versions, mods_get_title}, config::Cfg, error::{MLE, MLError, ErrorType}}; | 5 | use crate::{List, modrinth::Version, db::{userlist_add_disabled_versions, mods_get_info}, config::Cfg, error::{MLE, MLError, ErrorType}}; |
6 | 6 | ||
7 | pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) -> MLE<String> { | 7 | pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) -> MLE<String> { |
8 | 8 | ||
@@ -11,8 +11,8 @@ pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) | |||
11 | println!(" └Download mods to {}", dl_path); | 11 | println!(" └Download mods to {}", dl_path); |
12 | 12 | ||
13 | for ver in versions { | 13 | for ver in versions { |
14 | let project_name = mods_get_title(config.clone(), &ver.project_id)?; | 14 | let project_info = mods_get_info(config.clone(), &ver.project_id)?; |
15 | print!("\t└({})Download version {}", project_name, ver.id); | 15 | print!("\t└({})Download version {}", project_info.title, ver.id); |
16 | //Force flush of stdout, else print! doesn't print instantly | 16 | //Force flush of stdout, else print! doesn't print instantly |
17 | std::io::stdout().flush().unwrap(); | 17 | std::io::stdout().flush().unwrap(); |
18 | let primary_file = ver.files.into_iter().find(|file| file.primary).unwrap(); | 18 | let primary_file = ver.files.into_iter().find(|file| file.primary).unwrap(); |