Example #1
0
        public async Task <ActionResult> Update([FromBody] SettingsControllerUpdateRequest request)
        {
            await _settings.Update(request.Settings);

            _torrents.Reset();

            return(Ok());
        }
        public async Task <ActionResult> Update([FromBody] SettingsControllerUpdateRequest request)
        {
            await _settings.Update(request.Settings);

            _torrents.Reset();

            var logLevelSetting = await _settings.GetString("LogLevel");

            if (!Enum.TryParse <LogEventLevel>(logLevelSetting, out var logLevel))
            {
                logLevel = LogEventLevel.Information;
            }

            Program.LoggingLevelSwitch.MinimumLevel = logLevel;

            return(Ok());
        }