New: Add additional fields to Webhook Manual Interaction Required events

This commit is contained in:
Alex Cortelyou 2024-03-27 22:30:21 -07:00 committed by GitHub
parent 35d0e6a6f8
commit 1ec1ce58e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 0 deletions

View File

@ -178,6 +178,8 @@ namespace NzbDrone.Core.Notifications.Webhook
DownloadClient = message.DownloadClientInfo?.Name, DownloadClient = message.DownloadClientInfo?.Name,
DownloadClientType = message.DownloadClientInfo?.Type, DownloadClientType = message.DownloadClientInfo?.Type,
DownloadId = message.DownloadId, DownloadId = message.DownloadId,
DownloadStatus = message.TrackedDownload.Status.ToString(),
DownloadStatusMessages = message.TrackedDownload.StatusMessages.Select(x => new WebhookDownloadStatusMessage(x)).ToList(),
CustomFormatInfo = new WebhookCustomFormatInfo(remoteEpisode.CustomFormats, remoteEpisode.CustomFormatScore), CustomFormatInfo = new WebhookCustomFormatInfo(remoteEpisode.CustomFormats, remoteEpisode.CustomFormatScore),
Release = new WebhookGrabbedRelease(message.Release) Release = new WebhookGrabbedRelease(message.Release)
}; };

View File

@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Download.TrackedDownloads;
namespace NzbDrone.Core.Notifications.Webhook
{
public class WebhookDownloadStatusMessage
{
public string Title { get; set; }
public List<string> Messages { get; set; }
public WebhookDownloadStatusMessage(TrackedDownloadStatusMessage statusMessage)
{
Title = statusMessage.Title;
Messages = statusMessage.Messages.ToList();
}
}
}

View File

@ -10,6 +10,8 @@ namespace NzbDrone.Core.Notifications.Webhook
public string DownloadClient { get; set; } public string DownloadClient { get; set; }
public string DownloadClientType { get; set; } public string DownloadClientType { get; set; }
public string DownloadId { get; set; } public string DownloadId { get; set; }
public string DownloadStatus { get; set; }
public List<WebhookDownloadStatusMessage> DownloadStatusMessages { get; set; }
public WebhookCustomFormatInfo CustomFormatInfo { get; set; } public WebhookCustomFormatInfo CustomFormatInfo { get; set; }
public WebhookGrabbedRelease Release { get; set; } public WebhookGrabbedRelease Release { get; set; }
} }