From 86a12f95d2774ff4fbb8770a437636fed60e2396 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 25 Nov 2014 07:21:33 -0800 Subject: [PATCH] Updated NzbDrone to Sonarr in notifications --- src/NzbDrone.Core/Notifications/Email/EmailService.cs | 2 +- src/NzbDrone.Core/Notifications/Growl/GrowlService.cs | 5 +++-- .../Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs | 4 ++-- src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs | 4 ++-- .../Notifications/PushBullet/PushBulletProxy.cs | 4 ++-- src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs | 6 +++--- src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs | 2 +- .../Notifications/Pushover/PushoverSettings.cs | 1 + src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs | 2 +- src/NzbDrone.Core/Notifications/Xbmc/XbmcJsonApiProxy.cs | 2 +- 10 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Email/EmailService.cs b/src/NzbDrone.Core/Notifications/Email/EmailService.cs index 27655faeb..cb4d2a578 100644 --- a/src/NzbDrone.Core/Notifications/Email/EmailService.cs +++ b/src/NzbDrone.Core/Notifications/Email/EmailService.cs @@ -72,7 +72,7 @@ namespace NzbDrone.Core.Notifications.Email try { - SendEmail(settings, "NzbDrone - Test Notification", body); + SendEmail(settings, "Sonarr - Test Notification", body); } catch (Exception ex) { diff --git a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs index d08fbc66d..96d3cc272 100644 --- a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs +++ b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs @@ -22,6 +22,7 @@ namespace NzbDrone.Core.Notifications.Growl { private readonly Logger _logger; + //TODO: Change this to Sonarr, but it is a breaking change (v3) private readonly Application _growlApplication = new Application("NzbDrone"); private readonly NotificationType[] _notificationTypes; @@ -102,7 +103,7 @@ namespace NzbDrone.Core.Notifications.Growl private void Register(string host, int port, string password) { - _logger.Debug("Registering NzbDrone with Growl host: {0}:{1}", host, port); + _logger.Debug("Registering Sonarr with Growl host: {0}:{1}", host, port); var growlConnector = GetGrowlConnector(host, port, password); @@ -146,7 +147,7 @@ namespace NzbDrone.Core.Notifications.Growl Register(settings.Host, settings.Port, settings.Password); const string title = "Test Notification"; - const string body = "This is a test message from NzbDrone"; + const string body = "This is a test message from Sonarr"; SendNotification(title, body, "TEST", settings.Host, settings.Port, settings.Password); } diff --git a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs index 3aca9b420..44dd8b3e6 100644 --- a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs +++ b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs @@ -32,7 +32,7 @@ namespace NzbDrone.Core.Notifications.NotifyMyAndroid var request = new RestRequest("notify", Method.POST); request.RequestFormat = DataFormat.Xml; request.AddParameter("apikey", apiKey); - request.AddParameter("application", "NzbDrone"); + request.AddParameter("application", "Sonarr"); request.AddParameter("event", title); request.AddParameter("description", message); request.AddParameter("priority", (int)priority); @@ -69,7 +69,7 @@ namespace NzbDrone.Core.Notifications.NotifyMyAndroid try { const string title = "Test Notification"; - const string body = "This is a test message from NzbDrone"; + const string body = "This is a test message from Sonarr"; Verify(settings.ApiKey); SendNotification(title, body, settings.ApiKey, (NotifyMyAndroidPriority)settings.Priority); } diff --git a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs index 29a8d5af0..798d7baf9 100644 --- a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs +++ b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs @@ -26,7 +26,7 @@ namespace NzbDrone.Core.Notifications.Prowl { var notification = new Prowlin.Notification { - Application = "NzbDrone", + Application = "Sonarr", Description = message, Event = title, Priority = priority, @@ -88,7 +88,7 @@ namespace NzbDrone.Core.Notifications.Prowl Verify(settings.ApiKey); const string title = "Test Notification"; - const string body = "This is a test message from NzbDrone"; + const string body = "This is a test message from Sonarr"; SendNotification(title, body, settings.ApiKey); } diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs index 4683c96ad..068f0b6d2 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs @@ -58,8 +58,8 @@ namespace NzbDrone.Core.Notifications.PushBullet { try { - const string title = "NzbDrone - Test Notification"; - const string body = "This is a test message from NzbDrone"; + const string title = "Sonarr - Test Notification"; + const string body = "This is a test message from Sonarr"; SendNotification(title, body, settings.ApiKey, settings.DeviceId); } diff --git a/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs b/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs index aeb3a71d0..6688a95fd 100644 --- a/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs +++ b/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs @@ -29,8 +29,8 @@ namespace NzbDrone.Core.Notifications.Pushalot var client = RestClientFactory.BuildClient(URL); var request = BuildRequest(); - request.AddParameter("Source", "NzbDrone"); - request.AddParameter("Image", "https://raw.githubusercontent.com/NzbDrone/NzbDrone/master/Logo/128.png"); + request.AddParameter("Source", "Sonarr"); + request.AddParameter("Image", "https://raw.githubusercontent.com/Sonarr/Sonarr/develop/Logo/128.png"); request.AddParameter("Title", title); request.AddParameter("Body", message); @@ -61,7 +61,7 @@ namespace NzbDrone.Core.Notifications.Pushalot try { const string title = "Test Notification"; - const string body = "This is a test message from NzbDrone"; + const string body = "This is a test message from Sonarr"; SendNotification(title, body, settings); } diff --git a/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs b/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs index 97739702b..2f3187202 100644 --- a/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs +++ b/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Notifications.Pushover try { const string title = "Test Notification"; - const string body = "This is a test message from NzbDrone"; + const string body = "This is a test message from Sonarr"; SendNotification(title, body, settings.ApiKey, settings.UserKey, (PushoverPriority)settings.Priority, settings.Sound); } diff --git a/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs b/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs index 0b0276e85..51c2ab86a 100644 --- a/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs +++ b/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs @@ -23,6 +23,7 @@ namespace NzbDrone.Core.Notifications.Pushover Priority = 0; } + //TODO: Get Pushover to change our app name (or create a new app) when we have a new logo [FieldDefinition(0, Label = "API Key", HelpLink = "https://pushover.net/apps/clone/nzbdrone")] public String ApiKey { get; set; } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs index 142aa0def..2dfa9843b 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Core.Notifications.Xbmc public void Notify(XbmcSettings settings, string title, string message) { - var notification = String.Format("Notification({0},{1},{2},{3})", title, message, settings.DisplayTime * 1000, "https://raw.github.com/NzbDrone/NzbDrone/develop/Logo/64.png"); + var notification = String.Format("Notification({0},{1},{2},{3})", title, message, settings.DisplayTime * 1000, "https://raw.github.com/Sonarr/Sonarr/develop/Logo/64.png"); var command = BuildExecBuiltInCommand(notification); SendCommand(settings, command); diff --git a/src/NzbDrone.Core/Notifications/Xbmc/XbmcJsonApiProxy.cs b/src/NzbDrone.Core/Notifications/Xbmc/XbmcJsonApiProxy.cs index 703847ea3..402e948f0 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/XbmcJsonApiProxy.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/XbmcJsonApiProxy.cs @@ -41,7 +41,7 @@ namespace NzbDrone.Core.Notifications.Xbmc var parameters = new Dictionary(); parameters.Add("title", title); parameters.Add("message", message); - parameters.Add("image", "https://raw.github.com/NzbDrone/NzbDrone/develop/Logo/64.png"); + parameters.Add("image", "https://raw.github.com/Sonarr/Sonarr/develop/Logo/64.png"); parameters.Add("displaytime", settings.DisplayTime * 1000); ProcessRequest(request, settings, "GUI.ShowNotification", parameters);