public async Task <IActionResult> GetSonarrProfiles([FromBody] TestSonarrSettingsModel model) { try { var profiles = await SonarrClient.GetProfiles(_httpClientFactory.CreateClient(), _logger, ConvertToSonarrSettings(model)); return(Ok(profiles.Select(x => new SonarrProfile { Id = x.id, Name = x.name }))); } catch (System.Exception) { return(BadRequest($"Could not load the profiles from Sonarr, check your settings.")); } }