mirror of
https://github.com/Readarr/Readarr
synced 2025-12-31 12:42:25 +01:00
New: Add Editions to Webhook Payloads
This commit is contained in:
parent
d93329a3fd
commit
22781b62e6
3 changed files with 26 additions and 12 deletions
|
|
@ -28,13 +28,7 @@ public WebhookGrabPayload BuildOnGrabPayload(GrabMessage message)
|
|||
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 @@ public class WebhookBook
|
|||
{
|
||||
public WebhookBook()
|
||||
{
|
||||
Editions = new List<WebhookBookEdition>();
|
||||
}
|
||||
|
||||
public WebhookBook(Book book)
|
||||
|
|
@ -15,16 +18,13 @@ public WebhookBook(Book book)
|
|||
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…
Reference in a new issue