From e033ce1eff2d2ed546944449d44506e875705cd5 Mon Sep 17 00:00:00 2001 From: geogolem Date: Sun, 16 Aug 2020 00:32:53 -0400 Subject: [PATCH] New: Add OnDelete Notification to TraktConnection to remove movies from Trakt Collection when they are removed from Radarr Add OnDelete Notification to TraktConnection to remove movies from Trakt Collection when they are removed from Radarr skip the deleteHandler if the delete Event was triggered for reason: Upgrade change migration from 180 to 182 since 180 and 181 are already in plan to be used address comments regarding helpText for OnDelete and move check for OnUpgrade deletion reason into trakt connection OnDelete handler reuse TraktCollectMoviesResource for OnDelete trakt api should just ignore the other properties anyway add WithDefaultValue to migration add unit test case for onDelete to fix unit testcase for onDelete --- .../Notifications/Notification.js | 13 ++++++++- .../Notifications/NotificationEventItems.js | 13 +++++++++ .../Notifications/NotificationModule.cs | 4 +++ .../Notifications/NotificationResource.cs | 2 ++ .../NotificationBaseFixture.cs | 7 +++++ .../Migration/182_on_delete_notification.cs | 14 ++++++++++ src/NzbDrone.Core/Datastore/TableMapping.cs | 1 + .../Notifications/DeleteMessage.cs | 20 ++++++++++++++ .../Notifications/INotification.cs | 2 ++ .../Notifications/NotificationBase.cs | 5 ++++ .../Notifications/NotificationDefinition.cs | 4 ++- .../Notifications/NotificationFactory.cs | 7 +++++ .../Notifications/NotificationService.cs | 27 ++++++++++++++++++- .../Notifications/Trakt/Trakt.cs | 8 ++++++ .../Notifications/Trakt/TraktProxy.cs | 19 +++++++++++++ .../Notifications/Trakt/TraktService.cs | 22 +++++++++++++++ .../Notifications/NotificationResource.cs | 6 +++++ 17 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 src/NzbDrone.Core/Datastore/Migration/182_on_delete_notification.cs create mode 100644 src/NzbDrone.Core/Notifications/DeleteMessage.cs diff --git a/frontend/src/Settings/Notifications/Notifications/Notification.js b/frontend/src/Settings/Notifications/Notifications/Notification.js index d329006ab..751840232 100644 --- a/frontend/src/Settings/Notifications/Notifications/Notification.js +++ b/frontend/src/Settings/Notifications/Notifications/Notification.js @@ -59,11 +59,13 @@ class Notification extends Component { onDownload, onUpgrade, onRename, + onDelete, onHealthIssue, supportsOnGrab, supportsOnDownload, supportsOnUpgrade, supportsOnRename, + supportsOnDelete, supportsOnHealthIssue } = this.props; @@ -84,6 +86,13 @@ class Notification extends Component { } + { + supportsOnDelete && onDelete && + + } + { supportsOnDownload && onDownload &&