1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-25 01:11:43 +00:00

New: Add more information to Webhook payload

Fixes #5104

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
Qstick 2020-10-04 00:39:45 -04:00
parent 37197150be
commit a66b2cf416
2 changed files with 13 additions and 0 deletions

View file

@ -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 @@ public override void OnDownload(DownloadMessage message)
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);
}

View file

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