Fix minor issues with options loading

This commit is contained in:
Matt Nadareski
2025-10-07 18:27:12 -04:00
parent bf181e2294
commit 08829ed811
3 changed files with 3 additions and 5 deletions

View File

@@ -23,6 +23,7 @@
- More consistency in commandline programs
- Use GC.SharpCompress as archive handling library
- Start wiring through log compression changes
- Fix minor issues with options loading
### 3.4.2 (2025-09-30)

View File

@@ -570,7 +570,7 @@ namespace MPF.Frontend
}
set
{
Settings["InternalProgram"] = value.ToString();
Settings["LogCompression"] = value.ToString();
}
}

View File

@@ -188,12 +188,9 @@ namespace MPF.Frontend.Tools
if (string.IsNullOrEmpty(ConfigurationPath))
return new Options();
// Ensure the file exists
// If the file does not exist
if (!File.Exists(ConfigurationPath) || new FileInfo(ConfigurationPath).Length == 0)
{
File.Create(ConfigurationPath).Dispose();
return new Options();
}
var serializer = JsonSerializer.Create();
var stream = File.Open(ConfigurationPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);