Require ApiKey for all actions in SonarrImport

(cherry picked from commit 19b8fbe13bf584b915a05fe9fc87622adbaee0b7)

Closes #3798
This commit is contained in:
Bogdan 2023-06-04 16:28:32 +03:00
parent e4341a1b60
commit 75862028a2
1 changed files with 17 additions and 19 deletions

View File

@ -103,11 +103,11 @@ namespace NzbDrone.Core.ImportLists.Lidarr
return new
{
options = devices.OrderBy(d => d.Name, StringComparer.InvariantCultureIgnoreCase)
.Select(d => new
{
Value = d.Id,
Name = d.Name
})
.Select(d => new
{
Value = d.Id,
Name = d.Name
})
};
}
@ -118,28 +118,26 @@ namespace NzbDrone.Core.ImportLists.Lidarr
return new
{
options = devices.OrderBy(d => d.Label, StringComparer.InvariantCultureIgnoreCase)
.Select(d => new
{
Value = d.Id,
Name = d.Label
})
.Select(d => new
{
Value = d.Id,
Name = d.Label
})
};
}
if (action == "getRootFolders")
{
Settings.Validate().Filter("ApiKey").ThrowOnError();
var remoteRootfolders = _lidarrV1Proxy.GetRootFolders(Settings);
var remoteRootFolders = _lidarrV1Proxy.GetRootFolders(Settings);
return new
{
options = remoteRootfolders.OrderBy(d => d.Path, StringComparer.InvariantCultureIgnoreCase)
.Select(d => new
{
value = d.Path,
name = d.Path
})
options = remoteRootFolders.OrderBy(d => d.Path, StringComparer.InvariantCultureIgnoreCase)
.Select(d => new
{
value = d.Path,
name = d.Path
})
};
}