From a83b5217666bde0b27676071d72c4abfd20c44ab Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 25 Jun 2024 06:25:33 -0700 Subject: [PATCH] New: 'On Import Complete' notification when all episodes in a release are imported Closes #363 --- .../Notifications/Notification.js | 16 ++- .../Notifications/NotificationEventItems.js | 15 +- .../Store/Actions/Settings/notifications.js | 1 + .../ImportFixture.cs | 4 + ...add_on_import_complete_to_notifications.cs | 14 ++ src/NzbDrone.Core/Datastore/TableMapping.cs | 1 + .../Download/CompletedDownloadService.cs | 29 +++- .../Download/DownloadCompletedEvent.cs | 13 +- .../TrackedDownloadAlreadyImported.cs | 2 +- .../UntrackedDownloadCompletedEvent.cs | 26 ++++ src/NzbDrone.Core/Localization/Core/en.json | 3 +- .../EpisodeImport/ImportApprovedEpisodes.cs | 2 +- .../MediaFiles/EpisodeImport/ImportResult.cs | 12 +- .../Manual/ManualImportService.cs | 29 +++- .../Notifications/Apprise/Apprise.cs | 5 + .../CustomScript/CustomScript.cs | 61 ++++++++ .../Notifications/Email/Email.cs | 7 + .../Notifications/Gotify/Gotify.cs | 5 + .../Notifications/INotification.cs | 2 + .../Notifications/ImportCompleteMessage.cs | 29 ++++ src/NzbDrone.Core/Notifications/Join/Join.cs | 5 + .../Notifications/Mailgun/Mailgun.cs | 5 + .../MediaBrowser/MediaBrowser.cs | 13 ++ .../Notifications/Notifiarr/Notifiarr.cs | 5 + .../Notifications/NotificationBase.cs | 7 + .../Notifications/NotificationDefinition.cs | 6 +- .../Notifications/NotificationFactory.cs | 12 ++ .../Notifications/NotificationService.cs | 131 ++++++++++++++++-- src/NzbDrone.Core/Notifications/Ntfy/Ntfy.cs | 5 + .../Notifications/Plex/Server/PlexServer.cs | 5 + .../Notifications/Prowl/Prowl.cs | 5 + .../Notifications/PushBullet/PushBullet.cs | 5 + .../Notifications/Pushcut/Pushcut.cs | 5 + .../Notifications/Pushover/Pushover.cs | 5 + .../Notifications/SendGrid/SendGrid.cs | 5 + .../Notifications/Signal/Signal.cs | 5 + .../Notifications/Simplepush/Simplepush.cs | 5 + .../Notifications/Slack/Slack.cs | 17 +++ .../Notifications/Synology/SynologyIndexer.cs | 8 ++ .../Notifications/Telegram/Telegram.cs | 7 + .../Notifications/Trakt/Trakt.cs | 7 + .../Notifications/Twitter/Twitter.cs | 5 + .../Notifications/Webhook/Webhook.cs | 5 + .../Notifications/Webhook/WebhookBase.cs | 23 +++ .../Webhook/WebhookGrabbedRelease.cs | 19 ++- .../Webhook/WebhookImportCompletePayload.cs | 18 +++ src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs | 8 ++ .../Parser/Model/GrabbedReleaseInfo.cs | 4 + .../Notifications/NotificationResource.cs | 6 + 49 files changed, 597 insertions(+), 35 deletions(-) create mode 100644 src/NzbDrone.Core/Datastore/Migration/209_add_on_import_complete_to_notifications.cs create mode 100644 src/NzbDrone.Core/Download/UntrackedDownloadCompletedEvent.cs create mode 100644 src/NzbDrone.Core/Notifications/ImportCompleteMessage.cs create mode 100644 src/NzbDrone.Core/Notifications/Webhook/WebhookImportCompletePayload.cs diff --git a/frontend/src/Settings/Notifications/Notifications/Notification.js b/frontend/src/Settings/Notifications/Notifications/Notification.js index e7de0b308..22e17c18f 100644 --- a/frontend/src/Settings/Notifications/Notifications/Notification.js +++ b/frontend/src/Settings/Notifications/Notifications/Notification.js @@ -59,6 +59,7 @@ class Notification extends Component { onGrab, onDownload, onUpgrade, + onImportComplete, onRename, onSeriesAdd, onSeriesDelete, @@ -71,6 +72,7 @@ class Notification extends Component { supportsOnGrab, supportsOnDownload, supportsOnUpgrade, + supportsOnImportComplete, supportsOnRename, supportsOnSeriesAdd, supportsOnSeriesDelete, @@ -105,7 +107,7 @@ class Notification extends Component { { supportsOnDownload && onDownload ? : null } @@ -118,6 +120,14 @@ class Notification extends Component { null } + { + supportsOnImportComplete && onImportComplete ? + : + null + } + { supportsOnRename && onRename ?