From 474f4bcc6dbb98b9072132a2ded54902d8589dab Mon Sep 17 00:00:00 2001 From: Robin Dadswell <19610103+RobinDadswell@users.noreply.github.com> Date: Sat, 30 Jan 2021 22:54:26 +0000 Subject: [PATCH] New: On Episode File Delete For Upgrade notification option --- .../EditNotificationModalContent.js | 19 +++++++++++++++++++ .../Notifications/Notification.js | 12 ++++++++++++ .../Store/Actions/Settings/notifications.js | 1 + .../NotificationBaseFixture.cs | 2 ++ ...53_add_on_episodefiledelete_for_upgrade.cs | 15 +++++++++++++++ src/NzbDrone.Core/Datastore/TableMapping.cs | 1 + .../CustomScript/CustomScript.cs | 1 + .../Notifications/INotification.cs | 1 + .../Notifications/NotificationBase.cs | 1 + .../Notifications/NotificationDefinition.cs | 4 +++- .../Notifications/NotificationFactory.cs | 6 ++++++ .../Notifications/NotificationService.cs | 7 +++++-- .../Notifications/Webhook/Webhook.cs | 3 ++- .../Webhook/WebhookEpisodeDeletePayload.cs | 2 ++ .../Notifications/NotificationResource.cs | 6 ++++++ 15 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 src/NzbDrone.Core/Datastore/Migration/153_add_on_episodefiledelete_for_upgrade.cs diff --git a/frontend/src/Settings/Notifications/Notifications/EditNotificationModalContent.js b/frontend/src/Settings/Notifications/Notifications/EditNotificationModalContent.js index 0b993942a..fa24f65a5 100644 --- a/frontend/src/Settings/Notifications/Notifications/EditNotificationModalContent.js +++ b/frontend/src/Settings/Notifications/Notifications/EditNotificationModalContent.js @@ -44,6 +44,7 @@ function EditNotificationModalContent(props) { onRename, onSeriesDelete, onEpisodeFileDelete, + onEpisodeFileDeleteForUpgrade, onHealthIssue, supportsOnGrab, supportsOnDownload, @@ -51,6 +52,7 @@ function EditNotificationModalContent(props) { supportsOnRename, supportsOnSeriesDelete, supportsOnEpisodeFileDelete, + supportsOnEpisodeFileDeleteForUpgrade, supportsOnHealthIssue, includeHealthWarnings, tags, @@ -180,6 +182,23 @@ function EditNotificationModalContent(props) { /> + { + onEpisodeFileDelete.value ? + + On Episode File Delete For Upgrade + + + : + null + } + On Health Issue diff --git a/frontend/src/Settings/Notifications/Notifications/Notification.js b/frontend/src/Settings/Notifications/Notifications/Notification.js index 3460f611c..7b317d313 100644 --- a/frontend/src/Settings/Notifications/Notifications/Notification.js +++ b/frontend/src/Settings/Notifications/Notifications/Notification.js @@ -60,6 +60,7 @@ class Notification extends Component { onRename, onSeriesDelete, onEpisodeFileDelete, + onEpisodeFileDeleteForUpgrade, onHealthIssue, supportsOnGrab, supportsOnDownload, @@ -67,6 +68,7 @@ class Notification extends Component { supportsOnRename, supportsOnSeriesDelete, supportsOnEpisodeFileDelete, + supportsOnEpisodeFileDeleteForUpgrade, supportsOnHealthIssue } = this.props; @@ -136,6 +138,14 @@ class Notification extends Component { null } + { + supportsOnEpisodeFileDeleteForUpgrade && onEpisodeFileDelete && onEpisodeFileDeleteForUpgrade ? + : + null + } + { !onGrab && !onDownload && !onRename && !onHealthIssue && !onSeriesDelete && !onEpisodeFileDelete ?