summaryrefslogtreecommitdiff
path: root/src/files.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2023-05-25 17:23:52 +0200
committerfxqnlr <[email protected]>2023-05-25 17:23:52 +0200
commit48393b209396db9ddd44251b2bb445d3ad7533fb (patch)
tree264b459bacc0f6c62f26c3fd45c83ee9946babe2 /src/files.rs
parent529d52534c300aec4a6e3e9e08f9762a401f7086 (diff)
downloadmodlist-48393b209396db9ddd44251b2bb445d3ad7533fb.tar
modlist-48393b209396db9ddd44251b2bb445d3ad7533fb.tar.gz
modlist-48393b209396db9ddd44251b2bb445d3ad7533fb.zip
changed a whole lot og references, fuck rust
Diffstat (limited to 'src/files.rs')
-rw-r--r--src/files.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/files.rs b/src/files.rs
index 04b00f0..565d2b6 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -14,11 +14,9 @@ use crate::{
14 db::{mods_get_info, userlist_add_disabled_versions}, 14 db::{mods_get_info, userlist_add_disabled_versions},
15 error::{ErrorType, MLError, MLE}, 15 error::{ErrorType, MLError, MLE},
16 modrinth::Version, 16 modrinth::Version,
17 List, 17 List, PROGRESS_CHARS,
18}; 18};
19 19
20const PROGRESS_CHARS: &str = "#>-";
21
22pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) -> MLE<()> { 20pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) -> MLE<()> {
23 let cached = get_cached_versions(&config.cache); 21 let cached = get_cached_versions(&config.cache);
24 22
@@ -89,7 +87,7 @@ async fn download_version(config: Cfg, list: List, version: Version, mut cached:
89 87
90 progress.set_message(format!("Copy {} to cache", version.id)); 88 progress.set_message(format!("Copy {} to cache", version.id));
91 let dl_path_file = format!("{}/{}", list.download_folder, filename); 89 let dl_path_file = format!("{}/{}", list.download_folder, filename);
92 let cache_path = format!("{}/{}", &config.clone().cache, filename); 90 let cache_path = format!("{}/{}", &config.cache, filename);
93 91
94 copy(dl_path_file, cache_path)?; 92 copy(dl_path_file, cache_path)?;
95 } 93 }
@@ -135,7 +133,7 @@ async fn download_file(url: &str, path: &str, name: &str, progress: &ProgressBar
135} 133}
136 134
137pub fn disable_version( 135pub fn disable_version(
138 config: Cfg, 136 config: &Cfg,
139 current_list: List, 137 current_list: List,
140 versionid: String, 138 versionid: String,
141 mod_id: String, 139 mod_id: String,