Require ApiKey for all actions in RadarrImport

(cherry picked from commit 19b8fbe13bf584b915a05fe9fc87622adbaee0b7)

Closes #8692
This commit is contained in:
Bogdan 2023-06-04 16:28:32 +03:00
parent eeed935e3a
commit f4fe18a440
1 changed files with 12 additions and 14 deletions

View File

@ -95,11 +95,11 @@ namespace NzbDrone.Core.ImportLists.Radarr
return new return new
{ {
options = devices.OrderBy(d => d.Name, StringComparer.InvariantCultureIgnoreCase) options = devices.OrderBy(d => d.Name, StringComparer.InvariantCultureIgnoreCase)
.Select(d => new .Select(d => new
{ {
Value = d.Id, Value = d.Id,
Name = d.Name Name = d.Name
}) })
}; };
} }
@ -110,23 +110,21 @@ namespace NzbDrone.Core.ImportLists.Radarr
return new return new
{ {
options = devices.OrderBy(d => d.Label, StringComparer.InvariantCultureIgnoreCase) options = devices.OrderBy(d => d.Label, StringComparer.InvariantCultureIgnoreCase)
.Select(d => new .Select(d => new
{ {
Value = d.Id, Value = d.Id,
Name = d.Label Name = d.Label
}) })
}; };
} }
if (action == "getRootFolders") if (action == "getRootFolders")
{ {
Settings.Validate().Filter("ApiKey").ThrowOnError(); var remoteRootFolders = _radarrV3Proxy.GetRootFolders(Settings);
var remoteRootfolders = _radarrV3Proxy.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,