You've already forked AstralRinth
forked from didirus/AstralRinth
Profile Options (#120)
* init profile settings * more work * finish everything * Switch to index approach * Fix settings str split * Run lint
This commit is contained in:
@@ -113,7 +113,7 @@ impl Children {
|
||||
// Spawns a new child process and inserts it into the hashmap
|
||||
// Also, as the process ends, it spawns the follow-up process if it exists
|
||||
// By convention, ExitStatus is last command's exit status, and we exit on the first non-zero exit status
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(current_child))]
|
||||
#[theseus_macros::debug_pin]
|
||||
async fn sequential_process_manager(
|
||||
uuid: Uuid,
|
||||
|
||||
@@ -54,7 +54,7 @@ impl Metadata {
|
||||
}
|
||||
|
||||
// Attempt to fetch metadata and store in sled DB
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(io_semaphore))]
|
||||
#[theseus_macros::debug_pin]
|
||||
pub async fn init(
|
||||
dirs: &DirectoryInfo,
|
||||
|
||||
@@ -130,6 +130,8 @@ pub struct JavaSettings {
|
||||
pub override_version: Option<JavaVersion>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub extra_arguments: Option<Vec<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub custom_env_args: Option<Vec<(String, String)>>,
|
||||
}
|
||||
|
||||
impl Profile {
|
||||
@@ -169,7 +171,7 @@ impl Profile {
|
||||
})
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(self, semaphore, icon))]
|
||||
pub async fn set_icon<'a>(
|
||||
&'a mut self,
|
||||
cache_dir: &Path,
|
||||
@@ -295,7 +297,7 @@ impl Profile {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(self))]
|
||||
#[theseus_macros::debug_pin]
|
||||
pub async fn add_project_version(
|
||||
&self,
|
||||
@@ -342,7 +344,7 @@ impl Profile {
|
||||
Ok((path, version))
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(self, bytes))]
|
||||
#[theseus_macros::debug_pin]
|
||||
pub async fn add_project_bytes(
|
||||
&self,
|
||||
@@ -412,7 +414,7 @@ impl Profile {
|
||||
Ok(path)
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(self))]
|
||||
#[theseus_macros::debug_pin]
|
||||
pub async fn toggle_disable_project(
|
||||
&self,
|
||||
@@ -577,7 +579,7 @@ impl Profiles {
|
||||
};
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self))]
|
||||
#[tracing::instrument(skip(self, profile))]
|
||||
#[theseus_macros::debug_pin]
|
||||
pub async fn insert(&mut self, profile: Profile) -> crate::Result<&Self> {
|
||||
emit_profile(
|
||||
|
||||
@@ -200,7 +200,7 @@ pub enum ProjectMetadata {
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(io_semaphore))]
|
||||
#[theseus_macros::debug_pin]
|
||||
async fn read_icon_from_file(
|
||||
icon_path: Option<String>,
|
||||
@@ -251,7 +251,7 @@ async fn read_icon_from_file(
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(profile, io_semaphore, fetch_semaphore))]
|
||||
#[theseus_macros::debug_pin]
|
||||
pub async fn infer_data_from_files(
|
||||
profile: Profile,
|
||||
|
||||
@@ -20,12 +20,12 @@ pub struct Tags {
|
||||
}
|
||||
|
||||
impl Tags {
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(io_semaphore, fetch_semaphore))]
|
||||
#[theseus_macros::debug_pin]
|
||||
pub async fn init(
|
||||
dirs: &DirectoryInfo,
|
||||
io_semaphore: &IoSemaphore,
|
||||
fetch_sempahore: &FetchSemaphore,
|
||||
fetch_semaphore: &FetchSemaphore,
|
||||
) -> crate::Result<Self> {
|
||||
let mut tags = None;
|
||||
let tags_path = dirs.caches_meta_dir().join("tags.json");
|
||||
@@ -34,7 +34,7 @@ impl Tags {
|
||||
{
|
||||
tags = Some(tags_json);
|
||||
} else {
|
||||
match Self::fetch(fetch_sempahore).await {
|
||||
match Self::fetch(fetch_semaphore).await {
|
||||
Ok(tags_fetch) => tags = Some(tags_fetch),
|
||||
Err(err) => {
|
||||
tracing::warn!("Unable to fetch launcher tags: {err}")
|
||||
|
||||
Reference in New Issue
Block a user