forked from didirus/AstralRinth
Library improvements (#126)
* Base impl * Add grouping * Fix some styling things * Run linter * add missing features * add dev mode --------- Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com> Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
@@ -195,6 +195,7 @@ pub struct EditProfileMetadata {
|
||||
pub game_version: Option<String>,
|
||||
pub loader: Option<ModLoader>,
|
||||
pub loader_version: Option<LoaderVersion>,
|
||||
pub groups: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
// Edits a profile
|
||||
@@ -207,15 +208,19 @@ pub async fn profile_edit(
|
||||
profile::edit(path, |prof| {
|
||||
if let Some(metadata) = edit_profile.metadata.clone() {
|
||||
if let Some(name) = metadata.name {
|
||||
prof.metadata.name = name
|
||||
prof.metadata.name = name;
|
||||
}
|
||||
if let Some(game_version) = metadata.game_version {
|
||||
prof.metadata.game_version = game_version
|
||||
prof.metadata.game_version = game_version;
|
||||
}
|
||||
if let Some(loader) = metadata.loader {
|
||||
prof.metadata.loader = loader
|
||||
prof.metadata.loader = loader;
|
||||
}
|
||||
prof.metadata.loader_version = metadata.loader_version;
|
||||
|
||||
if let Some(groups) = metadata.groups {
|
||||
prof.metadata.groups = groups;
|
||||
}
|
||||
prof.metadata.loader_version = metadata.loader_version
|
||||
}
|
||||
|
||||
prof.java = edit_profile.java.clone();
|
||||
@@ -223,6 +228,8 @@ pub async fn profile_edit(
|
||||
prof.resolution = edit_profile.resolution;
|
||||
prof.hooks = edit_profile.hooks.clone();
|
||||
|
||||
prof.metadata.date_modified = chrono::Utc::now();
|
||||
|
||||
async { Ok(()) }
|
||||
})
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user