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