Skip to content

Commit f34c945

Browse files
committed
fix: mumod 配置格式
1 parent 917839e commit f34c945

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

AquaMai

MaiChartManager/Controllers/Mod/MuModService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public MuModConfigModel ReadConfig()
4141
}
4242

4343
var text = File.ReadAllText(ModPaths.MuModConfigPath);
44-
var model = Toml.ToModel<MuModConfigModel>(text) ?? new MuModConfigModel();
44+
var model = Toml.ToModel<MuModConfigModel>(text, options: new TomlModelOptions { ConvertPropertyName = name => name }) ?? new MuModConfigModel();
4545
model.Channel = string.IsNullOrWhiteSpace(model.Channel) ? "slow" : model.Channel;
4646
model.CachePath = string.IsNullOrWhiteSpace(model.CachePath) ? DefaultCacheRelativePath : model.CachePath;
4747
return model;
@@ -57,7 +57,7 @@ public void WriteChannel(string channel)
5757
var config = ReadConfig();
5858
config.Channel = channel;
5959

60-
var content = Toml.FromModel(config);
60+
var content = Toml.FromModel(config, new TomlModelOptions { ConvertPropertyName = name => name });
6161
var targetPath = ModPaths.MuModConfigPath;
6262
var dir = Path.GetDirectoryName(targetPath);
6363
if (!string.IsNullOrEmpty(dir))

0 commit comments

Comments
 (0)