mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 04:49:33 -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
|
namespace Ombi.Controllers.External
|
||||||
{
|
{
|
||||||
[Admin]
|
[Admin]
|
||||||
[ApiV1]
|
[ApiV1]
|
||||||
[Produces("application/json")]
|
[Produces("application/json")]
|
||||||
public class SonarrController : Controller
|
public class SonarrController : Controller
|
||||||
{
|
{
|
||||||
public SonarrController(ISonarrApi sonarr, ISettingsService<SonarrSettings> settings)
|
public SonarrController(ISonarrApi sonarr, ISettingsService<SonarrSettings> settings)
|
||||||
|
@ -55,7 +55,11 @@ namespace Ombi.Controllers.External
|
||||||
public async Task<IEnumerable<SonarrProfile>> GetProfiles()
|
public async Task<IEnumerable<SonarrProfile>> GetProfiles()
|
||||||
{
|
{
|
||||||
var settings = await SonarrSettings.GetSettingsAsync();
|
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>
|
/// <summary>
|
||||||
|
@ -66,7 +70,12 @@ namespace Ombi.Controllers.External
|
||||||
public async Task<IEnumerable<SonarrRootFolder>> GetRootFolders()
|
public async Task<IEnumerable<SonarrRootFolder>> GetRootFolders()
|
||||||
{
|
{
|
||||||
var settings = await SonarrSettings.GetSettingsAsync();
|
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