From 938b5f1ae33341b526d2d610256b6e56a9f531ed Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 3 Oct 2013 11:12:12 -0700 Subject: [PATCH] Connect to SAB over SSL (optional) New: Ability to connect to SABnzbd over SSL --- .../Configuration/ConfigService.cs | 9 +++++++- .../Configuration/IConfigService.cs | 1 + .../Download/Clients/Sabnzbd/SabnzbdClient.cs | 5 ++++- .../DownloadClient/SabViewTemplate.html | 21 +++++++++++++++++++ .../Quality/QualityLayoutTemplate.html | 2 +- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Configuration/ConfigService.cs b/src/NzbDrone.Core/Configuration/ConfigService.cs index 8a9b7a5d5..a7bebdb6d 100644 --- a/src/NzbDrone.Core/Configuration/ConfigService.cs +++ b/src/NzbDrone.Core/Configuration/ConfigService.cs @@ -128,6 +128,13 @@ namespace NzbDrone.Core.Configuration set { SetValue("SabOlderTvPriority", value); } } + public bool SabUseSsl + { + get { return GetValueBoolean("SabUseSsl", false); } + + set { SetValue("SabUseSsl", value); } + } + public String DownloadedEpisodesFolder { get { return GetValue(ConfigKey.DownloadedEpisodesFolder.ToString()); } @@ -162,7 +169,7 @@ namespace NzbDrone.Core.Configuration public DownloadClientType DownloadClient { - get { return GetValueEnum("DownloadClient", DownloadClientType.Sabnzbd); } + get { return GetValueEnum("DownloadClient", DownloadClientType.Blackhole); } set { SetValue("DownloadClient", value); } } diff --git a/src/NzbDrone.Core/Configuration/IConfigService.cs b/src/NzbDrone.Core/Configuration/IConfigService.cs index d84ed272b..e226740b0 100644 --- a/src/NzbDrone.Core/Configuration/IConfigService.cs +++ b/src/NzbDrone.Core/Configuration/IConfigService.cs @@ -18,6 +18,7 @@ namespace NzbDrone.Core.Configuration String SabTvCategory { get; set; } SabPriorityType SabRecentTvPriority { get; set; } SabPriorityType SabOlderTvPriority { get; set; } + Boolean SabUseSsl { get; set; } String DownloadedEpisodesFolder { get; set; } bool UseSeasonFolder { get; set; } string SeasonFolderFormat { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdClient.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdClient.cs index 7a6eac544..817f3a30d 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdClient.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdClient.cs @@ -221,7 +221,10 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd private string GetSabRequest(string action) { - return string.Format(@"http://{0}:{1}/api?{2}&apikey={3}&ma_username={4}&ma_password={5}", + var protocol = _configService.SabUseSsl ? "https" : "http"; + + return string.Format(@"{0}://{1}:{2}/api?{3}&apikey={4}&ma_username={5}&ma_password={6}", + protocol, _configService.SabHost, _configService.SabPort, action, diff --git a/src/UI/Settings/DownloadClient/SabViewTemplate.html b/src/UI/Settings/DownloadClient/SabViewTemplate.html index 25ae6e74a..39e194aa0 100644 --- a/src/UI/Settings/DownloadClient/SabViewTemplate.html +++ b/src/UI/Settings/DownloadClient/SabViewTemplate.html @@ -96,4 +96,25 @@ + +
+ + +
+
diff --git a/src/UI/Settings/Quality/QualityLayoutTemplate.html b/src/UI/Settings/Quality/QualityLayoutTemplate.html index eb7bc8890..5954e5eb4 100644 --- a/src/UI/Settings/Quality/QualityLayoutTemplate.html +++ b/src/UI/Settings/Quality/QualityLayoutTemplate.html @@ -3,7 +3,7 @@

- +