diff options
author | fxqnlr <[email protected]> | 2023-05-25 21:06:40 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-05-25 21:06:40 +0200 |
commit | 7f1a262999d7a8b7f12a97daf4b6722638dc62a1 (patch) | |
tree | c030a952891fba2f64427adad1113efc567ae54d /src/db.rs | |
parent | 48393b209396db9ddd44251b2bb445d3ad7533fb (diff) | |
download | modlist-7f1a262999d7a8b7f12a97daf4b6722638dc62a1.tar modlist-7f1a262999d7a8b7f12a97daf4b6722638dc62a1.tar.gz modlist-7f1a262999d7a8b7f12a97daf4b6722638dc62a1.zip |
more progress instead of print, more references
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -121,7 +121,7 @@ pub fn mods_get_info(config: &Cfg, id: &str) -> MLE<ModInfo> { | |||
121 | } | 121 | } |
122 | 122 | ||
123 | pub fn mods_remove(config: &Cfg, id: String) -> MLE<()> { | 123 | pub fn mods_remove(config: &Cfg, id: String) -> MLE<()> { |
124 | println!("Removing mod {} from database", id); | 124 | // println!("Removing mod {} from database", id); |
125 | 125 | ||
126 | let data = format!("{}/data.db", config.data); | 126 | let data = format!("{}/data.db", config.data); |
127 | let connection = Connection::open(data)?; | 127 | let connection = Connection::open(data)?; |
@@ -167,10 +167,10 @@ pub fn mods_get_versions(config: &Cfg, mods: Vec<String>) -> MLE<Vec<DBModlistVe | |||
167 | 167 | ||
168 | for ver in id_iter { | 168 | for ver in id_iter { |
169 | let version = ver?; | 169 | let version = ver?; |
170 | println!( | 170 | // println!( |
171 | "\t({}) Get versions from the database", | 171 | // "\t({}) Get versions from the database", |
172 | String::from(&version[2]) | 172 | // String::from(&version[2]) |
173 | ); | 173 | // ); |
174 | //println!("Found versions {} for mod {}", version[1], version[0]); | 174 | //println!("Found versions {} for mod {}", version[1], version[0]); |
175 | versionmaps.push(DBModlistVersions { | 175 | versionmaps.push(DBModlistVersions { |
176 | mod_id: String::from(&version[0]), | 176 | mod_id: String::from(&version[0]), |
@@ -229,12 +229,11 @@ pub fn userlist_get_all_ids(config: &Cfg, list_id: &str) -> MLE<Vec<String>> { | |||
229 | let id_iter = stmt.query_map([], |row| row.get::<usize, String>(0))?; | 229 | let id_iter = stmt.query_map([], |row| row.get::<usize, String>(0))?; |
230 | 230 | ||
231 | for id in id_iter { | 231 | for id in id_iter { |
232 | //println!("Found id {:?}", id.as_ref().unwrap()); | ||
233 | mod_ids.push(id?) | 232 | mod_ids.push(id?) |
234 | } | 233 | } |
235 | 234 | ||
236 | match mod_ids.is_empty() { | 235 | match mod_ids.is_empty() { |
237 | true => Err(MLError::new(ErrorType::DBError, "NO_MODS_USERLIST")), | 236 | true => Err(MLError::new(ErrorType::DBError, &format!("NO_MODS_USERLIST{}", list_id))), |
238 | false => Ok(mod_ids), | 237 | false => Ok(mod_ids), |
239 | } | 238 | } |
240 | } | 239 | } |
@@ -475,7 +474,7 @@ pub fn userlist_get_all_downloads( | |||
475 | 474 | ||
476 | for link in link_iter { | 475 | for link in link_iter { |
477 | let l = link?; | 476 | let l = link?; |
478 | println!("Found link {}", String::from(&l)); | 477 | // println!("Found link {}", String::from(&l)); |
479 | links.push(l) | 478 | links.push(l) |
480 | } | 479 | } |
481 | 480 | ||
@@ -498,7 +497,7 @@ pub fn lists_insert( | |||
498 | mod_loader: &Modloader, | 497 | mod_loader: &Modloader, |
499 | download_folder: &str, | 498 | download_folder: &str, |
500 | ) -> MLE<()> { | 499 | ) -> MLE<()> { |
501 | println!("Creating list {}", id); | 500 | // println!("Creating list {}", id); |
502 | 501 | ||
503 | let data = format!("{}/data.db", config.data); | 502 | let data = format!("{}/data.db", config.data); |
504 | let connection = Connection::open(data)?; | 503 | let connection = Connection::open(data)?; |