summaryrefslogtreecommitdiff
path: root/src/data/list.rs
blob: 0045b7a2080ada95ace9dec4f11c406ca73d85b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::{config::Cfg, db::{config_get_current_list, lists_get}, error::MLE};

use super::modloader::Modloader;

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct List {
    pub id: String,
    pub mc_version: String,
    pub modloader: Modloader,
    pub download_folder: String,
}

impl List {
    /// # Errors
    pub fn get_current_list(config: &Cfg) -> MLE<List> {
        let id = config_get_current_list(config)?;
        lists_get(config, &id)
    }
}