New: Add Editions to Webhook Payloads

pull/2234/head
Qstick 2 years ago
parent d93329a3fd
commit 22781b62e6

@ -28,13 +28,7 @@ namespace NzbDrone.Core.Notifications.Webhook
EventType = WebhookEventType.Grab,
InstanceName = _configFileProvider.InstanceName,
Author = new WebhookAuthor(message.Author),
Books = remoteBook.Books.ConvertAll(x => new WebhookBook(x)
{
// TODO: Stop passing these parameters inside an book v3
Quality = quality.Quality.Name,
QualityVersion = quality.Revision.Version,
ReleaseGroup = remoteBook.ParsedBookInfo.ReleaseGroup
}),
Books = remoteBook.Books.ConvertAll(x => new WebhookBook(x)),
Release = new WebhookRelease(quality, remoteBook),
DownloadClient = message.DownloadClientName,
DownloadClientType = message.DownloadClientType,

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Books;
namespace NzbDrone.Core.Notifications.Webhook
@ -7,6 +9,7 @@ namespace NzbDrone.Core.Notifications.Webhook
{
public WebhookBook()
{
Editions = new List<WebhookBookEdition>();
}
public WebhookBook(Book book)
@ -15,16 +18,13 @@ namespace NzbDrone.Core.Notifications.Webhook
GoodreadsId = book.ForeignBookId;
Title = book.Title;
ReleaseDate = book.ReleaseDate;
Editions = book.Editions.Value.Select(x => new WebhookBookEdition(x)).ToList();
}
public int Id { get; set; }
public string GoodreadsId { get; set; }
public string Title { get; set; }
public List<WebhookBookEdition> Editions { get; set; }
public DateTime? ReleaseDate { get; set; }
public string Quality { get; set; }
public int QualityVersion { get; set; }
public string ReleaseGroup { get; set; }
public string SceneName { get; set; }
}
}

@ -0,0 +1,20 @@
using NzbDrone.Core.Books;
namespace NzbDrone.Core.Notifications.Webhook
{
public class WebhookBookEdition
{
public WebhookBookEdition(Edition edition)
{
GoodreadsId = edition.ForeignEditionId;
Title = edition.Title;
Asin = edition.Asin;
Isbn13 = edition.Isbn13;
}
public string Title { get; set; }
public string GoodreadsId { get; set; }
public string Asin { get; set; }
public string Isbn13 { get; set; }
}
}
Loading…
Cancel
Save