From a9e03ed1ccb7b3b3945e9c6e34c6194f1d26580e Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 2 Oct 2020 22:51:00 -0400 Subject: [PATCH] New: Add DownloadClient and DownloadId to Webhook notifications Co-Authored-By: Mark McDowall Signed-off-by: Robin Dadswell --- src/NzbDrone.Core/Notifications/Webhook/Webhook.cs | 10 +++++++--- .../Notifications/Webhook/WebhookGrabPayload.cs | 2 ++ .../Notifications/Webhook/WebhookImportPayload.cs | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs index a914bc5f2..32bc9866f 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs @@ -34,7 +34,9 @@ namespace NzbDrone.Core.Notifications.Webhook QualityVersion = quality.Revision.Version, ReleaseGroup = remoteBook.ParsedBookInfo.ReleaseGroup }), - Release = new WebhookRelease(quality, remoteBook) + Release = new WebhookRelease(quality, remoteBook), + DownloadClient = message.DownloadClient, + DownloadId = message.DownloadId }; _proxy.SendWebhook(payload, Settings); @@ -47,10 +49,12 @@ namespace NzbDrone.Core.Notifications.Webhook var payload = new WebhookImportPayload { EventType = "Download", - Author = new WebhookAuthor(message.Author), + Artist = new WebhookAuthor(message.Author), Book = new WebhookBook(message.Book), BookFiles = bookFiles.ConvertAll(x => new WebhookBookFile(x)), - IsUpgrade = message.OldFiles.Any() + IsUpgrade = message.OldFiles.Any(), + DownloadClient = message.DownloadClient, + DownloadId = message.DownloadId }; _proxy.SendWebhook(payload, Settings); diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookGrabPayload.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookGrabPayload.cs index 60e42a8dc..c0824a6f0 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookGrabPayload.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookGrabPayload.cs @@ -6,5 +6,7 @@ namespace NzbDrone.Core.Notifications.Webhook { public List Books { get; set; } public WebhookRelease Release { get; set; } + public string DownloadClient { get; set; } + public string DownloadId { get; set; } } } diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs index 807e0b1bf..bf9c46502 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs @@ -7,5 +7,7 @@ namespace NzbDrone.Core.Notifications.Webhook public WebhookBook Book { get; set; } public List BookFiles { get; set; } public bool IsUpgrade { get; set; } + public string DownloadClient { get; set; } + public string DownloadId { get; set; } } }