summaryrefslogtreecommitdiff
path: root/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/db.rs b/src/db.rs
index 9428466..2c48cab 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -49,6 +49,9 @@ pub fn mods_get_all_ids(config: Cfg) -> Result<Vec<String>, Box<dyn std::error::
49/// 49///
50///Will return `MLError` when no mod id is found 50///Will return `MLError` when no mod id is found
51pub fn mods_get_id(data: &str, slug: &str) -> MLE<String> { 51pub fn mods_get_id(data: &str, slug: &str) -> MLE<String> {
52
53 //TODO check if "slug" is id
54
52 let data = devdir(format!("{}/data.db", data).as_str()); 55 let data = devdir(format!("{}/data.db", data).as_str());
53 let connection = Connection::open(data)?; 56 let connection = Connection::open(data)?;
54 57
@@ -192,8 +195,7 @@ pub fn userlist_get_all_ids(config: Cfg, list_id: String) -> MLE<Vec<String>> {
192 } 195 }
193} 196}
194 197
195 198pub fn userlist_remove(config: Cfg, list_id: &str, mod_id: &str) -> MLE<()> {
196pub fn userlist_remove(config: Cfg, list_id: String, mod_id: String) -> MLE<()> {
197 let data = devdir(format!("{}/data.db", config.data).as_str()); 199 let data = devdir(format!("{}/data.db", config.data).as_str());
198 let connection = Connection::open(data)?; 200 let connection = Connection::open(data)?;
199 201
@@ -242,7 +244,7 @@ pub fn userlist_get_all_applicable_versions_with_mods(config: Cfg, list_id: Stri
242 Ok(versions) 244 Ok(versions)
243} 245}
244 246
245pub fn userlist_get_current_version(config: Cfg, list_id: String, mod_id: String) -> MLE<String> { 247pub fn userlist_get_current_version(config: Cfg, list_id: &str, mod_id: &str) -> MLE<String> {
246 let data = devdir(format!("{}/data.db", config.data).as_str()); 248 let data = devdir(format!("{}/data.db", config.data).as_str());
247 let connection = Connection::open(data).unwrap(); 249 let connection = Connection::open(data).unwrap();
248 250
@@ -425,7 +427,7 @@ pub fn lists_get(config: Cfg, list_id: String) -> MLE<List> {
425 Ok(list) 427 Ok(list)
426} 428}
427 429
428pub fn lists_version(config: Cfg, list_id: String, version: String) -> MLE<()> { 430pub fn lists_version(config: Cfg, list_id: &str, version: &str) -> MLE<()> {
429 let data = devdir(format!("{}/data.db", config.data).as_str()); 431 let data = devdir(format!("{}/data.db", config.data).as_str());
430 let connection = Connection::open(data).unwrap(); 432 let connection = Connection::open(data).unwrap();
431 433