From 8ae354a56bd12d40f58587f934d12597143a3e9e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 12 Aug 2014 07:14:24 -0700 Subject: [PATCH] SAB test to warn if Category Local Path is set when connection is to localhost --- src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index 13f7e3d77..321dc1a07 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -361,6 +361,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd if (!Settings.TvCategoryLocalPath.IsNullOrWhiteSpace()) { failures.AddIfNotNull(TestFolder(Settings.TvCategoryLocalPath, "TvCategoryLocalPath")); + failures.AddIfNotNull(TestCategoryLocalPath()); } } @@ -460,5 +461,15 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd return null; } + + private ValidationFailure TestCategoryLocalPath() + { + if (Settings.Host == "127.0.0.1" || Settings.Host == "localhost") + { + return new ValidationFailure("TvCategoryLocalPath", "Do not set when SABnzbd is running on the same system as NzbDrone"); + } + + return null; + } } } \ No newline at end of file