diff options
Diffstat (limited to 'src/files.rs')
-rw-r--r-- | src/files.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/files.rs b/src/files.rs index 8c822b2..b9325ea 100644 --- a/src/files.rs +++ b/src/files.rs | |||
@@ -2,17 +2,17 @@ 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_name}, config::Cfg, error::{MLE, MLError, ErrorType}}; | 5 | use crate::{List, modrinth::Version, db::{userlist_add_disabled_versions, mods_get_title}, 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 | ||
9 | let dl_path = String::from(&list.download_folder); | 9 | let dl_path = String::from(&list.download_folder); |
10 | 10 | ||
11 | println!("Download to directory from: {} ({})", list.id, 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_name(config.clone(), &ver.project_id)?; | 14 | let project_name = mods_get_title(config.clone(), &ver.project_id)?; |
15 | print!("\t({})Download version {}", project_name, ver.id); | 15 | print!("\t└({})Download version {}", project_name, 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(); |
@@ -107,7 +107,7 @@ pub fn get_downloaded_versions(list: List) -> MLE<HashMap<String, String>> { | |||
107 | 107 | ||
108 | pub fn clean_list_dir(list: &List) -> MLE<()> { | 108 | pub fn clean_list_dir(list: &List) -> MLE<()> { |
109 | let dl_path = &list.download_folder; | 109 | let dl_path = &list.download_folder; |
110 | println!("Clean directory for: {}", list.id); | 110 | println!(" └Clean directory for: {}", list.id); |
111 | for entry in std::fs::read_dir(dl_path)? { | 111 | for entry in std::fs::read_dir(dl_path)? { |
112 | let entry = entry?; | 112 | let entry = entry?; |
113 | std::fs::remove_file(entry.path())?; | 113 | std::fs::remove_file(entry.path())?; |