feat: add command to set osu! user config values with improved error handling

This commit is contained in:
2025-07-03 15:04:25 +02:00
parent cfb0851065
commit d6958dd15d
3 changed files with 34 additions and 31 deletions

View File

@@ -3,7 +3,8 @@ use std::path::PathBuf;
use winreg::RegKey;
use winreg::enums::*;
use crate::utils::{check_folder_completeness, get_osu_user_config, get_osu_config};
use crate::utils::set_osu_user_config_value;
use crate::utils::{check_folder_completeness, get_osu_config, get_osu_user_config};
#[tauri::command]
pub fn get_hwid() -> String {
@@ -207,3 +208,12 @@ pub fn get_osu_release_stream(folder: String) -> String {
.and_then(|config| config.get("_ReleaseStream").cloned())
.unwrap_or_else(|| "Stable40".to_string());
}
#[tauri::command]
pub fn set_osu_config_value(
osu_folder_path: String,
key: String,
value: String,
) -> Result<bool, String> {
set_osu_user_config_value(&osu_folder_path, &key, &value)
}