Require ApiKey for all actions in SonarrImport

This commit is contained in:
Bogdan 2023-06-04 16:28:32 +03:00 committed by Mark McDowall
parent 2603138975
commit 19b8fbe13b
1 changed files with 19 additions and 23 deletions

View File

@ -87,10 +87,10 @@ namespace NzbDrone.Core.ImportLists.Sonarr
}; };
} }
if (action == "getProfiles")
{
Settings.Validate().Filter("ApiKey").ThrowOnError(); Settings.Validate().Filter("ApiKey").ThrowOnError();
if (action == "getProfiles")
{
var profiles = _sonarrV3Proxy.GetQualityProfiles(Settings); var profiles = _sonarrV3Proxy.GetQualityProfiles(Settings);
return new return new
@ -106,8 +106,6 @@ namespace NzbDrone.Core.ImportLists.Sonarr
if (action == "getLanguageProfiles") if (action == "getLanguageProfiles")
{ {
Settings.Validate().Filter("ApiKey").ThrowOnError();
var langProfiles = _sonarrV3Proxy.GetLanguageProfiles(Settings); var langProfiles = _sonarrV3Proxy.GetLanguageProfiles(Settings);
return new return new
@ -138,13 +136,11 @@ namespace NzbDrone.Core.ImportLists.Sonarr
if (action == "getRootFolders") if (action == "getRootFolders")
{ {
Settings.Validate().Filter("ApiKey").ThrowOnError(); var remoteRootFolders = _sonarrV3Proxy.GetRootFolders(Settings);
var remoteRootfolders = _sonarrV3Proxy.GetRootFolders(Settings);
return new return new
{ {
options = remoteRootfolders.OrderBy(d => d.Path, StringComparer.InvariantCultureIgnoreCase) options = remoteRootFolders.OrderBy(d => d.Path, StringComparer.InvariantCultureIgnoreCase)
.Select(d => new .Select(d => new
{ {
value = d.Path, value = d.Path,