summaryrefslogblamecommitdiff
path: root/src/data/list.rs
blob: 0045b7a2080ada95ace9dec4f11c406ca73d85b2 (plain) (tree)


















                                                                               
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)
    }
}