diff --git a/frontend/src/Settings/Notifications/Notifications/Notification.js b/frontend/src/Settings/Notifications/Notifications/Notification.js
index 76be45247..2982de6cd 100644
--- a/frontend/src/Settings/Notifications/Notifications/Notification.js
+++ b/frontend/src/Settings/Notifications/Notifications/Notification.js
@@ -63,6 +63,7 @@ class Notification extends Component {
onDownloadFailure,
onImportFailure,
onTrackRetag,
+ onApplicationUpdate,
supportsOnGrab,
supportsOnReleaseImport,
supportsOnUpgrade,
@@ -70,7 +71,8 @@ class Notification extends Component {
supportsOnHealthIssue,
supportsOnDownloadFailure,
supportsOnImportFailure,
- supportsOnTrackRetag
+ supportsOnTrackRetag,
+ supportsOnApplicationUpdate
} = this.props;
return (
@@ -86,62 +88,69 @@ class Notification extends Component {
{
supportsOnGrab && onGrab &&
}
{
supportsOnReleaseImport && onReleaseImport &&
}
{
supportsOnUpgrade && onReleaseImport && onUpgrade &&
}
{
supportsOnRename && onRename &&
}
{
supportsOnTrackRetag && onTrackRetag &&
}
{
supportsOnHealthIssue && onHealthIssue &&
}
{
supportsOnDownloadFailure && onDownloadFailure &&
}
{
supportsOnImportFailure && onImportFailure &&
+ }
+
+ {
+ supportsOnApplicationUpdate && onApplicationUpdate &&
+
}
{
!onGrab && !onReleaseImport && !onRename && !onTrackRetag &&
- !onHealthIssue && !onDownloadFailure && !onImportFailure &&
+ !onHealthIssue && !onDownloadFailure && !onImportFailure && !onApplicationUpdate &&
+
+
+
+
}
+
diff --git a/frontend/src/Store/Actions/Settings/notifications.js b/frontend/src/Store/Actions/Settings/notifications.js
index fb73d8991..b6a38022d 100644
--- a/frontend/src/Store/Actions/Settings/notifications.js
+++ b/frontend/src/Store/Actions/Settings/notifications.js
@@ -110,6 +110,7 @@ export default {
selectedSchema.onDownloadFailure = selectedSchema.supportsOnDownloadFailure;
selectedSchema.onImportFailure = selectedSchema.supportsOnImportFailure;
selectedSchema.onTrackRetag = selectedSchema.supportsOnTrackRetag;
+ selectedSchema.onApplicationUpdate = selectedSchema.supportsOnApplicationUpdate;
return selectedSchema;
});
diff --git a/src/Lidarr.Api.V1/Notifications/NotificationResource.cs b/src/Lidarr.Api.V1/Notifications/NotificationResource.cs
index 7badad97b..6b641a753 100644
--- a/src/Lidarr.Api.V1/Notifications/NotificationResource.cs
+++ b/src/Lidarr.Api.V1/Notifications/NotificationResource.cs
@@ -13,6 +13,7 @@ namespace Lidarr.Api.V1.Notifications
public bool OnDownloadFailure { get; set; }
public bool OnImportFailure { get; set; }
public bool OnTrackRetag { get; set; }
+ public bool OnApplicationUpdate { get; set; }
public bool SupportsOnGrab { get; set; }
public bool SupportsOnReleaseImport { get; set; }
public bool SupportsOnUpgrade { get; set; }
@@ -22,6 +23,7 @@ namespace Lidarr.Api.V1.Notifications
public bool SupportsOnDownloadFailure { get; set; }
public bool SupportsOnImportFailure { get; set; }
public bool SupportsOnTrackRetag { get; set; }
+ public bool SupportsOnApplicationUpdate { get; set; }
public string TestCommand { get; set; }
}
@@ -44,6 +46,7 @@ namespace Lidarr.Api.V1.Notifications
resource.OnDownloadFailure = definition.OnDownloadFailure;
resource.OnImportFailure = definition.OnImportFailure;
resource.OnTrackRetag = definition.OnTrackRetag;
+ resource.OnApplicationUpdate = definition.OnApplicationUpdate;
resource.SupportsOnGrab = definition.SupportsOnGrab;
resource.SupportsOnReleaseImport = definition.SupportsOnReleaseImport;
resource.SupportsOnUpgrade = definition.SupportsOnUpgrade;
@@ -53,6 +56,7 @@ namespace Lidarr.Api.V1.Notifications
resource.SupportsOnDownloadFailure = definition.SupportsOnDownloadFailure;
resource.SupportsOnImportFailure = definition.SupportsOnImportFailure;
resource.SupportsOnTrackRetag = definition.SupportsOnTrackRetag;
+ resource.SupportsOnApplicationUpdate = definition.SupportsOnApplicationUpdate;
return resource;
}
@@ -74,6 +78,7 @@ namespace Lidarr.Api.V1.Notifications
definition.OnDownloadFailure = resource.OnDownloadFailure;
definition.OnImportFailure = resource.OnImportFailure;
definition.OnTrackRetag = resource.OnTrackRetag;
+ definition.OnApplicationUpdate = resource.OnApplicationUpdate;
definition.SupportsOnGrab = resource.SupportsOnGrab;
definition.SupportsOnReleaseImport = resource.SupportsOnReleaseImport;
definition.SupportsOnUpgrade = resource.SupportsOnUpgrade;
@@ -83,6 +88,7 @@ namespace Lidarr.Api.V1.Notifications
definition.SupportsOnDownloadFailure = resource.SupportsOnDownloadFailure;
definition.SupportsOnImportFailure = resource.SupportsOnImportFailure;
definition.SupportsOnTrackRetag = resource.SupportsOnTrackRetag;
+ definition.SupportsOnApplicationUpdate = resource.SupportsOnApplicationUpdate;
return definition;
}
diff --git a/src/NzbDrone.Core.Test/NotificationTests/NotificationBaseFixture.cs b/src/NzbDrone.Core.Test/NotificationTests/NotificationBaseFixture.cs
index 0dadac30f..1bd31b234 100644
--- a/src/NzbDrone.Core.Test/NotificationTests/NotificationBaseFixture.cs
+++ b/src/NzbDrone.Core.Test/NotificationTests/NotificationBaseFixture.cs
@@ -81,6 +81,11 @@ namespace NzbDrone.Core.Test.NotificationTests
{
TestLogger.Info("OnTrackRetag was called");
}
+
+ public override void OnApplicationUpdate(ApplicationUpdateMessage updateMessage)
+ {
+ TestLogger.Info("OnApplicationUpdate was called");
+ }
}
private class TestNotificationWithNoEvents : NotificationBase
@@ -119,6 +124,7 @@ namespace NzbDrone.Core.Test.NotificationTests
notification.SupportsOnDownloadFailure.Should().BeTrue();
notification.SupportsOnImportFailure.Should().BeTrue();
notification.SupportsOnTrackRetag.Should().BeTrue();
+ notification.SupportsOnApplicationUpdate.Should().BeTrue();
}
[Test]
@@ -134,6 +140,7 @@ namespace NzbDrone.Core.Test.NotificationTests
notification.SupportsOnDownloadFailure.Should().BeFalse();
notification.SupportsOnImportFailure.Should().BeFalse();
notification.SupportsOnTrackRetag.Should().BeFalse();
+ notification.SupportsOnApplicationUpdate.Should().BeFalse();
}
}
}
diff --git a/src/NzbDrone.Core/Datastore/Migration/054_add_on_update_to_notifications.cs b/src/NzbDrone.Core/Datastore/Migration/054_add_on_update_to_notifications.cs
new file mode 100644
index 000000000..9b124df87
--- /dev/null
+++ b/src/NzbDrone.Core/Datastore/Migration/054_add_on_update_to_notifications.cs
@@ -0,0 +1,14 @@
+using FluentMigrator;
+using NzbDrone.Core.Datastore.Migration.Framework;
+
+namespace NzbDrone.Core.Datastore.Migration
+{
+ [Migration(054)]
+ public class add_on_update_to_notifications : NzbDroneMigrationBase
+ {
+ protected override void MainDbUpgrade()
+ {
+ Alter.Table("Notifications").AddColumn("OnApplicationUpdate").AsBoolean().WithDefaultValue(true);
+ }
+ }
+}
diff --git a/src/NzbDrone.Core/Datastore/TableMapping.cs b/src/NzbDrone.Core/Datastore/TableMapping.cs
index e19199a46..93a21b225 100644
--- a/src/NzbDrone.Core/Datastore/TableMapping.cs
+++ b/src/NzbDrone.Core/Datastore/TableMapping.cs
@@ -85,7 +85,8 @@ namespace NzbDrone.Core.Datastore
.Ignore(i => i.SupportsOnHealthIssue)
.Ignore(i => i.SupportsOnDownloadFailure)
.Ignore(i => i.SupportsOnImportFailure)
- .Ignore(i => i.SupportsOnTrackRetag);
+ .Ignore(i => i.SupportsOnTrackRetag)
+ .Ignore(i => i.SupportsOnApplicationUpdate);
Mapper.Entity("Metadata").RegisterModel()
.Ignore(x => x.ImplementationName)
diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json
index 8e3c49a67..75f12bb08 100644
--- a/src/NzbDrone.Core/Localization/Core/en.json
+++ b/src/NzbDrone.Core/Localization/Core/en.json
@@ -375,13 +375,23 @@
"NoTagsHaveBeenAddedYetAddTagsToLinkArtistsWithDelayProfilesRestrictionsOrNotificationsClickLinkTohttpswikiservarrcomlidarrsettingstagshereLinkToFindOutMoreAboutTagsInLidarr": "No tags have been added yet. Add tags to link artists with delay profiles, restrictions, or notifications. Click here to find out more about tags in Lidarr.",
"NotificationTriggers": "Notification Triggers",
"NoUpdatesAreAvailable": "No updates are available",
+ "OnApplicationUpdate": "On Application Update",
+ "OnApplicationUpdateHelpText": "On Application Update",
+ "OnDownloadFailure": "On Download Failure",
"OnDownloadFailureHelpText": "On Download Failure",
+ "OnGrab": "On Grab",
"OnGrabHelpText": "On Grab",
+ "OnHealthIssue": "On Health Issue",
"OnHealthIssueHelpText": "On Health Issue",
+ "OnImportFailure": "On Import Failure",
"OnImportFailureHelpText": "On Import Failure",
+ "OnReleaseImport": "On Release Import",
"OnReleaseImportHelpText": "On Release Import",
+ "OnRename": "On Rename",
"OnRenameHelpText": "On Rename",
+ "OnTrackRetag": "On Track Retag",
"OnTrackRetagHelpText": "On Track Retag",
+ "OnUpgrade": "On Upgrade",
"OnUpgradeHelpText": "On Upgrade",
"OpenBrowserOnStart": "Open browser on start",
"Options": "Options",
diff --git a/src/NzbDrone.Core/Notifications/ApplicationUpdateMessage.cs b/src/NzbDrone.Core/Notifications/ApplicationUpdateMessage.cs
new file mode 100644
index 000000000..1819ad423
--- /dev/null
+++ b/src/NzbDrone.Core/Notifications/ApplicationUpdateMessage.cs
@@ -0,0 +1,16 @@
+using System;
+
+namespace NzbDrone.Core.Notifications
+{
+ public class ApplicationUpdateMessage
+ {
+ public string Message { get; set; }
+ public Version PreviousVersion { get; set; }
+ public Version NewVersion { get; set; }
+
+ public override string ToString()
+ {
+ return NewVersion.ToString();
+ }
+ }
+}
diff --git a/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs b/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs
index f493c7f96..f2aba0d49 100644
--- a/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs
+++ b/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs
@@ -41,6 +41,11 @@ namespace NzbDrone.Core.Notifications.Boxcar
_proxy.SendNotification(IMPORT_FAILURE_TITLE, message.Message, Settings);
}
+ public override void OnApplicationUpdate(ApplicationUpdateMessage message)
+ {
+ _proxy.SendNotification(APPLICATION_UPDATE_TITLE, message.Message, Settings);
+ }
+
public override ValidationResult Test()
{
var failures = new List();
diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs
index 4bf18d40b..21c978108 100644
--- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs
+++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs
@@ -155,6 +155,18 @@ namespace NzbDrone.Core.Notifications.CustomScript
ExecuteScript(environmentVariables);
}
+ public override void OnApplicationUpdate(ApplicationUpdateMessage updateMessage)
+ {
+ var environmentVariables = new StringDictionary();
+
+ environmentVariables.Add("Lidarr_EventType", "ApplicationUpdate");
+ environmentVariables.Add("Lidarr_Update_Message", updateMessage.Message);
+ environmentVariables.Add("Lidarr_Update_NewVersion", updateMessage.NewVersion.ToString());
+ environmentVariables.Add("Lidarr_Update_PreviousVersion", updateMessage.PreviousVersion.ToString());
+
+ ExecuteScript(environmentVariables);
+ }
+
public override ValidationResult Test()
{
var failures = new List();
diff --git a/src/NzbDrone.Core/Notifications/Discord/Discord.cs b/src/NzbDrone.Core/Notifications/Discord/Discord.cs
index 112bbe55c..dafaa288f 100644
--- a/src/NzbDrone.Core/Notifications/Discord/Discord.cs
+++ b/src/NzbDrone.Core/Notifications/Discord/Discord.cs
@@ -309,6 +309,41 @@ namespace NzbDrone.Core.Notifications.Discord
_proxy.SendPayload(payload, Settings);
}
+ public override void OnApplicationUpdate(ApplicationUpdateMessage updateMessage)
+ {
+ var attachments = new List