New: Add more information to Webhook payload

Fixes #5104

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
pull/5142/head
Qstick 4 years ago
parent 37197150be
commit a66b2cf416

@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using FluentValidation.Results; using FluentValidation.Results;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
@ -51,6 +52,15 @@ namespace NzbDrone.Core.Notifications.Webhook
DownloadId = message.DownloadId 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); _proxy.SendWebhook(payload, Settings);
} }

@ -1,3 +1,5 @@
using System.Collections.Generic;
namespace NzbDrone.Core.Notifications.Webhook namespace NzbDrone.Core.Notifications.Webhook
{ {
public class WebhookImportPayload : WebhookPayload public class WebhookImportPayload : WebhookPayload
@ -7,5 +9,6 @@ namespace NzbDrone.Core.Notifications.Webhook
public bool IsUpgrade { get; set; } public bool IsUpgrade { get; set; }
public string DownloadClient { get; set; } public string DownloadClient { get; set; }
public string DownloadId { get; set; } public string DownloadId { get; set; }
public List<WebhookMovieFile> DeletedFiles { get; set; }
} }
} }

Loading…
Cancel
Save