Browse Source

Switch some settings paths to use Compat

pull/55/head
Ionite 1 year ago
parent
commit
efd4e2f13f
No known key found for this signature in database
  1. 8
      StabilityMatrix.Core/Services/SettingsManager.cs

8
StabilityMatrix.Core/Services/SettingsManager.cs

@ -213,14 +213,12 @@ public class SettingsManager : ISettingsManager
/// </summary>
public void SetLibraryPath(string path)
{
var appDataDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
var homeDir = Path.Combine(appDataDir, "StabilityMatrix");
Directory.CreateDirectory(homeDir);
var libraryJsonPath = Path.Combine(homeDir, "library.json");
Compat.AppDataHome.Create();
var libraryJsonFile = Compat.AppDataHome.JoinFile("library.json");
var library = new LibrarySettings { LibraryPath = path };
var libraryJson = JsonSerializer.Serialize(library, new JsonSerializerOptions { WriteIndented = true });
File.WriteAllText(libraryJsonPath, libraryJson);
libraryJsonFile.WriteAllText(libraryJson);
// actually create the LibraryPath directory
Directory.CreateDirectory(path);

Loading…
Cancel
Save