Fixed some errors on SettingsDictionary
This commit is contained in:
@@ -32,15 +32,22 @@ public class Config
|
||||
Directory.CreateDirectory("./Data/Logs");
|
||||
|
||||
AppSettings = new SettingsDictionary<string, string>("./Data/Resources/config.json");
|
||||
bool response = await AppSettings.LoadFromFile();
|
||||
|
||||
if (!response)
|
||||
throw new Exception("Invalid config file");
|
||||
|
||||
AppSettings["LogFolder"] = "./Data/Logs";
|
||||
AppSettings["PluginFolder"] = "./Data/Plugins";
|
||||
AppSettings["ArchiveFolder"] = "./Data/Archives";
|
||||
|
||||
AppSettings["PluginDatabase"] = "./Data/Resources/plugins.json";
|
||||
|
||||
|
||||
ArchiveManager.Initialize();
|
||||
|
||||
|
||||
|
||||
if (!File.Exists(AppSettings["PluginDatabase"]))
|
||||
{
|
||||
List<PluginInfo> plugins = new();
|
||||
@@ -49,15 +56,15 @@ public class Config
|
||||
|
||||
Logger = new Logger(false, true, AppSettings["LogFolder"] + $"/{DateTime.Today.ToShortDateString().Replace("/", "")}.log");
|
||||
|
||||
|
||||
_isLoaded = true;
|
||||
|
||||
|
||||
PluginsManager = new PluginsManager("releases");
|
||||
|
||||
await PluginsManager.UninstallMarkedPlugins();
|
||||
|
||||
await PluginsManager.CheckForUpdates();
|
||||
|
||||
_isLoaded = true;
|
||||
|
||||
Logger.Log("Config initialized", typeof(Config));
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user