diff --git a/src/NzbDrone.Common/Disk/SystemFolders.cs b/src/NzbDrone.Common/Disk/SystemFolders.cs index c108e3d02..1c81ab1e0 100644 --- a/src/NzbDrone.Common/Disk/SystemFolders.cs +++ b/src/NzbDrone.Common/Disk/SystemFolders.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using NzbDrone.Common.EnvironmentInfo; @@ -24,7 +24,8 @@ namespace NzbDrone.Common.Disk "/boot", "/lib", "/sbin", - "/proc" + "/proc", + "/usr/bin" }; } } diff --git a/src/Prowlarr.Api.V1/DownloadClient/DownloadClientController.cs b/src/Prowlarr.Api.V1/DownloadClient/DownloadClientController.cs index c2e927924..994db6c69 100644 --- a/src/Prowlarr.Api.V1/DownloadClient/DownloadClientController.cs +++ b/src/Prowlarr.Api.V1/DownloadClient/DownloadClientController.cs @@ -12,15 +12,5 @@ namespace Prowlarr.Api.V1.DownloadClient : base(downloadClientFactory, "downloadclient", ResourceMapper) { } - - protected override void Validate(DownloadClientDefinition definition, bool includeWarnings) - { - if (!definition.Enable) - { - return; - } - - base.Validate(definition, includeWarnings); - } } } diff --git a/src/Prowlarr.Api.V1/Indexers/IndexerController.cs b/src/Prowlarr.Api.V1/Indexers/IndexerController.cs index 48adfcf52..c184e2436 100644 --- a/src/Prowlarr.Api.V1/Indexers/IndexerController.cs +++ b/src/Prowlarr.Api.V1/Indexers/IndexerController.cs @@ -10,15 +10,5 @@ namespace Prowlarr.Api.V1.Indexers : base(indexerFactory, "indexer", resourceMapper) { } - - protected override void Validate(IndexerDefinition definition, bool includeWarnings) - { - if (!definition.Enable) - { - return; - } - - base.Validate(definition, includeWarnings); - } } } diff --git a/src/Prowlarr.Api.V1/Notifications/NotificationController.cs b/src/Prowlarr.Api.V1/Notifications/NotificationController.cs index f8dfbbc3c..310d2dd0b 100644 --- a/src/Prowlarr.Api.V1/Notifications/NotificationController.cs +++ b/src/Prowlarr.Api.V1/Notifications/NotificationController.cs @@ -12,15 +12,5 @@ namespace Prowlarr.Api.V1.Notifications : base(notificationFactory, "notification", ResourceMapper) { } - - protected override void Validate(NotificationDefinition definition, bool includeWarnings) - { - if (!definition.OnHealthIssue) - { - return; - } - - base.Validate(definition, includeWarnings); - } } } diff --git a/src/Prowlarr.Api.V1/ProviderControllerBase.cs b/src/Prowlarr.Api.V1/ProviderControllerBase.cs index 0be76531b..ea37ea535 100644 --- a/src/Prowlarr.Api.V1/ProviderControllerBase.cs +++ b/src/Prowlarr.Api.V1/ProviderControllerBase.cs @@ -62,7 +62,7 @@ namespace Prowlarr.Api.V1 [Produces("application/json")] public ActionResult CreateProvider(TProviderResource providerResource) { - var providerDefinition = GetDefinition(providerResource, false); + var providerDefinition = GetDefinition(providerResource, true, false, false); if (providerDefinition.Enable) { @@ -78,7 +78,7 @@ namespace Prowlarr.Api.V1 [Produces("application/json")] public ActionResult UpdateProvider(TProviderResource providerResource) { - var providerDefinition = GetDefinition(providerResource, false); + var providerDefinition = GetDefinition(providerResource, true, false, false); var forceSave = Request.GetBooleanQueryParameter("forceSave"); // Only test existing definitions if it is enabled and forceSave isn't set. @@ -92,11 +92,11 @@ namespace Prowlarr.Api.V1 return Accepted(providerResource.Id); } - private TProviderDefinition GetDefinition(TProviderResource providerResource, bool includeWarnings = false, bool validate = true) + private TProviderDefinition GetDefinition(TProviderResource providerResource, bool validate, bool includeWarnings, bool forceValidate) { var definition = _resourceMapper.ToModel(providerResource); - if (validate) + if (validate && (definition.Enable || forceValidate)) { Validate(definition, includeWarnings); } @@ -139,7 +139,7 @@ namespace Prowlarr.Api.V1 [HttpPost("test")] public object Test([FromBody] TProviderResource providerResource) { - var providerDefinition = GetDefinition(providerResource, true); + var providerDefinition = GetDefinition(providerResource, true, true, true); Test(providerDefinition, true); @@ -172,7 +172,7 @@ namespace Prowlarr.Api.V1 [HttpPost("action/{name}")] public IActionResult RequestAction(string name, [FromBody] TProviderResource resource) { - var providerDefinition = GetDefinition(resource, true, false); + var providerDefinition = GetDefinition(resource, false, false, false); var query = Request.Query.ToDictionary(x => x.Key, x => x.Value.ToString()); @@ -181,7 +181,7 @@ namespace Prowlarr.Api.V1 return Json(data); } - protected virtual void Validate(TProviderDefinition definition, bool includeWarnings) + private void Validate(TProviderDefinition definition, bool includeWarnings) { var validationResult = definition.Settings.Validate();