Ability to update settings. Take effect on next reboot.

This commit is contained in:
Joseph Milazzo 2021-02-04 16:49:48 -06:00
parent e60f795410
commit 1050fa4e54
21 changed files with 953 additions and 146 deletions

View file

@ -9,16 +9,24 @@ namespace API.Helpers.Converters
{
public ServerSettingDto Convert(IEnumerable<ServerSetting> source, ServerSettingDto destination, ResolutionContext context)
{
destination = new ServerSettingDto();
destination ??= new ServerSettingDto();
foreach (var row in source)
{
switch (row.Key)
{
case "CacheDirectory":
case ServerSettingKey.CacheDirectory:
destination.CacheDirectory = row.Value;
break;
default:
case ServerSettingKey.TaskScan:
destination.TaskScan = row.Value;
break;
case ServerSettingKey.LoggingLevel:
destination.LoggingLevel = row.Value;
break;
case ServerSettingKey.TaskBackup:
destination.TaskBackup = row.Value;
break;
}
}