diff --git a/src/Ombi/Controllers/V1/External/SonarrController.cs b/src/Ombi/Controllers/V1/External/SonarrController.cs index 1d63c6013..0bcd39c55 100644 --- a/src/Ombi/Controllers/V1/External/SonarrController.cs +++ b/src/Ombi/Controllers/V1/External/SonarrController.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -59,6 +60,7 @@ public Task> GetRootFolders([FromBody] SonarrSetti [PowerUser] public async Task> GetProfiles() { + SonarrSettings.ClearCache(); var settings = await SonarrSettings.GetSettingsAsync(); if (settings.Enabled) { @@ -75,6 +77,7 @@ public async Task> GetProfiles() [PowerUser] public async Task> GetRootFolders() { + SonarrSettings.ClearCache(); var settings = await SonarrSettings.GetSettingsAsync(); if (settings.Enabled) { @@ -92,6 +95,7 @@ public async Task> GetRootFolders() [PowerUser] public async Task> GetLanguageProfiles() { + SonarrSettings.ClearCache(); var settings = await SonarrSettings.GetSettingsAsync(); if (settings.Enabled) { @@ -147,6 +151,7 @@ public async Task> GetLanguageProfiles([FromBody] [PowerUser] public async Task Enabled() { + SonarrSettings.ClearCache(); var settings = await SonarrSettings.GetSettingsAsync(); return settings.Enabled; } @@ -155,13 +160,21 @@ public async Task Enabled() [PowerUser] public async Task SonarrVersion() { + SonarrSettings.ClearCache(); var settings = await SonarrSettings.GetSettingsAsync(); if (!settings.Enabled) { return string.Empty; } - var status = await SonarrV3Api.SystemStatus(settings.ApiKey, settings.FullUri); - return status.version; + try + { + var status = await SonarrV3Api.SystemStatus(settings.ApiKey, settings.FullUri); + return status.version; + } + catch (Exception) + { + return string.Empty; + } } } } \ No newline at end of file