From 5487acb041b4ee2feb3ba7f25163f498e899a9e7 Mon Sep 17 00:00:00 2001 From: Martijn van Duijneveldt Date: Sun, 27 Mar 2022 21:33:20 +0200 Subject: [PATCH] Add DeletedFiles on WebhookImportPayload Expose DeleteFiles so it matches the model provided by Radarr/Sonarr Used to trigger remove of file when upgrading --- src/NzbDrone.Core/Notifications/Webhook/Webhook.cs | 5 +++++ .../Notifications/Webhook/WebhookImportPayload.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs index c55f44a64..9257b7601 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs @@ -63,6 +63,11 @@ namespace NzbDrone.Core.Notifications.Webhook DownloadId = message.DownloadId }; + if (message.OldFiles.Any()) + { + payload.DeletedFiles = message.OldFiles.ConvertAll(x => new WebhookTrackFile(x)); + } + _proxy.SendWebhook(payload, Settings); } diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs index 172ff2e43..bc98d0bc9 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookImportPayload.cs @@ -7,6 +7,7 @@ namespace NzbDrone.Core.Notifications.Webhook public WebhookArtist Artist { get; set; } public List Tracks { get; set; } public List TrackFiles { get; set; } + public List DeletedFiles { get; set; } public bool IsUpgrade { get; set; } public string DownloadClient { get; set; } public string DownloadId { get; set; }