mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Stop the root folder and profile calls from erroring
This commit is contained in:
parent
58af83959e
commit
63a1d41597
1 changed files with 14 additions and 5 deletions
|
@ -11,9 +11,9 @@ using Ombi.Settings.Settings.Models.External;
|
|||
|
||||
namespace Ombi.Controllers.External
|
||||
{
|
||||
[Admin]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
[Admin]
|
||||
[ApiV1]
|
||||
[Produces("application/json")]
|
||||
public class SonarrController : Controller
|
||||
{
|
||||
public SonarrController(ISonarrApi sonarr, ISettingsService<SonarrSettings> settings)
|
||||
|
@ -55,7 +55,11 @@ namespace Ombi.Controllers.External
|
|||
public async Task<IEnumerable<SonarrProfile>> GetProfiles()
|
||||
{
|
||||
var settings = await SonarrSettings.GetSettingsAsync();
|
||||
return await SonarrApi.GetProfiles(settings.ApiKey, settings.FullUri);
|
||||
if (settings.Enabled)
|
||||
{
|
||||
return await SonarrApi.GetProfiles(settings.ApiKey, settings.FullUri);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -66,7 +70,12 @@ namespace Ombi.Controllers.External
|
|||
public async Task<IEnumerable<SonarrRootFolder>> GetRootFolders()
|
||||
{
|
||||
var settings = await SonarrSettings.GetSettingsAsync();
|
||||
return await SonarrApi.GetRootFolders(settings.ApiKey, settings.FullUri);
|
||||
if (settings.Enabled)
|
||||
{
|
||||
return await SonarrApi.GetRootFolders(settings.ApiKey, settings.FullUri);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue