From 24a2c2be59e66e0892ef87f022464d14655e7282 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 2 Nov 2011 21:01:44 -0700 Subject: [PATCH] Finishing up Prowl integration. --- IISExpress/AppServer/applicationhost.config | 4 ++-- NzbDrone.Core/CentralDispatch.cs | 1 + NzbDrone.Web/Controllers/SettingsController.cs | 10 ++++++++++ NzbDrone.Web/Models/NotificationSettingsModel.cs | 8 ++++++++ NzbDrone.Web/Views/Settings/Notifications.cshtml | 2 +- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/IISExpress/AppServer/applicationhost.config b/IISExpress/AppServer/applicationhost.config index 0ae7782f5..93879e48b 100644 --- a/IISExpress/AppServer/applicationhost.config +++ b/IISExpress/AppServer/applicationhost.config @@ -125,8 +125,8 @@ - - + + diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index 37a3fb385..930d60aa3 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -107,6 +107,7 @@ private static void BindExternalNotifications() _kernel.Bind().To(); _kernel.Bind().To(); _kernel.Bind().To(); + _kernel.Bind().To(); var notifiers = _kernel.GetAll(); _kernel.Get().InitializeNotifiers(notifiers.ToList()); diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index 2eb01cd3e..d7bea1647 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -490,6 +490,16 @@ public JsonResult SaveNotifications(NotificationSettingsModel data) _configProvider.GrowlHost = data.GrowlHost; _configProvider.GrowlPassword = data.GrowlPassword; + //Prowl + var prowlSettings = _externalNotificationProvider.GetSettings(typeof(Prowl)); + prowlSettings.Enable = data.ProwlEnabled; + _externalNotificationProvider.SaveSettings(prowlSettings); + + _configProvider.ProwlNotifyOnGrab = data.ProwlNotifyOnGrab; + _configProvider.ProwlNotifyOnDownload = data.ProwlNotifyOnDownload; + _configProvider.ProwlApiKeys = data.ProwlApiKeys; + _configProvider.ProwlPriority = data.ProwlPriority; + return GetSuccessResult(); } diff --git a/NzbDrone.Web/Models/NotificationSettingsModel.cs b/NzbDrone.Web/Models/NotificationSettingsModel.cs index 5abed1911..caeaf6228 100644 --- a/NzbDrone.Web/Models/NotificationSettingsModel.cs +++ b/NzbDrone.Web/Models/NotificationSettingsModel.cs @@ -125,12 +125,16 @@ public class NotificationSettingsModel [Description("Send notification when episode is downloaded?")] public bool GrowlNotifyOnDownload { get; set; } + [DataType(DataType.Text)] [DisplayName("Host running Growl")] [Description("Host or IP Address:Port")] + [DisplayFormat(ConvertEmptyStringToNull = false)] public string GrowlHost { get; set; } + [DataType(DataType.Text)] [DisplayName("Growl host Password")] [Description("Password is required if Growl is running on another system")] + [DisplayFormat(ConvertEmptyStringToNull = false)] public string GrowlPassword { get; set; } @@ -147,12 +151,16 @@ public class NotificationSettingsModel [Description("Send notification when episode is downloaded?")] public bool ProwlNotifyOnDownload { get; set; } + [DataType(DataType.Text)] [DisplayName("API Keys")] [Description("Comma-Separated list of API Keys")] + [DisplayFormat(ConvertEmptyStringToNull = false)] public string ProwlApiKeys { get; set; } + [DataType(DataType.Text)] [DisplayName("Priority")] [Description("Priority to send alerts to Prowl with")] + [DisplayFormat(ConvertEmptyStringToNull = false)] public int ProwlPriority { get; set; } public SelectList ProwlPrioritySelectList { get; set; } diff --git a/NzbDrone.Web/Views/Settings/Notifications.cshtml b/NzbDrone.Web/Views/Settings/Notifications.cshtml index f62558de6..3476e2b68 100644 --- a/NzbDrone.Web/Views/Settings/Notifications.cshtml +++ b/NzbDrone.Web/Views/Settings/Notifications.cshtml @@ -58,7 +58,7 @@
  • SMTP
  • Twitter
  • Growl
  • -
  • Prowl
  • +
  • Prowl
  • @{Html.RenderPartial("Xbmc", Model);}