diff --git a/NzbDrone.Api/Notifications/NotificationModule.cs b/NzbDrone.Api/Notifications/NotificationModule.cs index da14fbedc..2279a8623 100644 --- a/NzbDrone.Api/Notifications/NotificationModule.cs +++ b/NzbDrone.Api/Notifications/NotificationModule.cs @@ -34,7 +34,7 @@ namespace NzbDrone.Api.Notifications var notificationResource = new NotificationResource(); notificationResource.InjectFrom(notification); notificationResource.Fields = SchemaBuilder.GenerateSchema(notification.Settings); - notificationResource.Command = String.Format("test{0}", notification.Implementation.ToLowerInvariant()); + notificationResource.TestCommand = String.Format("test{0}", notification.Implementation.ToLowerInvariant()); result.Add(notificationResource); } diff --git a/NzbDrone.Api/Notifications/NotificationResource.cs b/NzbDrone.Api/Notifications/NotificationResource.cs index 05a9c0162..1406571e5 100644 --- a/NzbDrone.Api/Notifications/NotificationResource.cs +++ b/NzbDrone.Api/Notifications/NotificationResource.cs @@ -13,6 +13,6 @@ namespace NzbDrone.Api.Notifications public Boolean OnDownload { get; set; } public List Fields { get; set; } public String Implementation { get; set; } - public String Command { get; set; } + public String TestCommand { get; set; } } } \ No newline at end of file diff --git a/NzbDrone.Api/Notifications/NotificationSchemaModule.cs b/NzbDrone.Api/Notifications/NotificationSchemaModule.cs index 229d69e1a..e838f62f8 100644 --- a/NzbDrone.Api/Notifications/NotificationSchemaModule.cs +++ b/NzbDrone.Api/Notifications/NotificationSchemaModule.cs @@ -31,7 +31,7 @@ namespace NzbDrone.Api.Notifications var notificationResource = new NotificationResource(); notificationResource.InjectFrom(notification); notificationResource.Fields = SchemaBuilder.GenerateSchema(notification.Settings); - notificationResource.Command = String.Format("test{0}", notification.Implementation.ToLowerInvariant()); + notificationResource.TestCommand = String.Format("test{0}", notification.Implementation.ToLowerInvariant()); result.Add(notificationResource); } diff --git a/UI/Commands/CommandController.js b/UI/Commands/CommandController.js index 535fa3c28..ce22c5a6e 100644 --- a/UI/Commands/CommandController.js +++ b/UI/Commands/CommandController.js @@ -4,7 +4,7 @@ define(['app'], function () { NzbDrone.Commands.Execute = function (name, properties) { var data = { command: name }; - if (properties !== undefined) { + if (!properties) { $.extend(data, properties); } diff --git a/UI/Settings/Notifications/EditView.js b/UI/Settings/Notifications/EditView.js index b3ea0442f..7e93901b8 100644 --- a/UI/Settings/Notifications/EditView.js +++ b/UI/Settings/Notifications/EditView.js @@ -49,8 +49,8 @@ define([ }, _test: function () { - var command = this.model.get('command'); - if (command) { + var testCommand = this.model.get('testCommand'); + if (testCommand) { this.idle = false; this.ui.testButton.addClass('disabled'); this.ui.testIcon.removeClass('icon-question'); @@ -58,12 +58,12 @@ define([ var properties = {}; - _.each(this.model.attributes.fields, function (field) { + _.each(this.model.get('fields'), function (field) { properties[field.name] = field.value; }); var self = this; - var commandPromise = NzbDrone.Commands.Execute(command, properties); + var commandPromise = NzbDrone.Commands.Execute(testCommand, properties); commandPromise.done(function () { NzbDrone.Shared.Messenger.show({ message: 'Notification settings tested successfully'