From a66b2cf4165d30c0ba2051b14ef5b6e143d99789 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 4 Oct 2020 00:39:45 -0400 Subject: [PATCH] New: Add more information to Webhook payload Fixes #5104 Co-Authored-By: Mark McDowall --- src/NzbDrone.Core/Notifications/Webhook/Webhook.cs | 10 ++++++++++ .../Notifications/Webhook/WebhookImportPayload.cs | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs index ac8faa2a5..1812b9f72 100755 --- a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.IO; using System.Linq; using FluentValidation.Results; using NzbDrone.Common.Extensions; @@ -51,6 +52,15 @@ namespace NzbDrone.Core.Notifications.Webhook DownloadId = message.DownloadId }; + if (message.OldMovieFiles.Any()) + { + payload.DeletedFiles = message.OldMovieFiles.ConvertAll(x => + new WebhookMovieFile(x) + { + Path = Path.Combine(message.Movie.Path, x.RelativePath) + }); + } + _proxy.SendWebhook(payload, Settings); } diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs index 6037b660c..e44a4564b 100755 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; + namespace NzbDrone.Core.Notifications.Webhook { public class WebhookImportPayload : WebhookPayload @@ -7,5 +9,6 @@ namespace NzbDrone.Core.Notifications.Webhook public bool IsUpgrade { get; set; } public string DownloadClient { get; set; } public string DownloadId { get; set; } + public List DeletedFiles { get; set; } } }