From 2c36a6c25ffc4afbf8b55f5b9ed147e41b06b1fe Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 4 Jun 2023 16:28:32 +0300 Subject: [PATCH] Require ApiKey for all actions in SonarrImport (cherry picked from commit 19b8fbe13bf584b915a05fe9fc87622adbaee0b7) Closes #2600 --- .../ImportLists/Readarr/ReadarrImport.cs | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/NzbDrone.Core/ImportLists/Readarr/ReadarrImport.cs b/src/NzbDrone.Core/ImportLists/Readarr/ReadarrImport.cs index 36310c578..88da51fcd 100644 --- a/src/NzbDrone.Core/ImportLists/Readarr/ReadarrImport.cs +++ b/src/NzbDrone.Core/ImportLists/Readarr/ReadarrImport.cs @@ -108,11 +108,11 @@ namespace NzbDrone.Core.ImportLists.Readarr 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 + }) }; } @@ -123,28 +123,26 @@ namespace NzbDrone.Core.ImportLists.Readarr 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 = _readarrV1Proxy.GetRootFolders(Settings); + var remoteRootFolders = _readarrV1Proxy.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 + }) }; }