From 9e5966365c68f250e3b9b216d2674e669c27ccdd Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 1 Jul 2020 22:25:21 +0100 Subject: [PATCH] Fixed: Send correct covers to Goodreads Also use original release date and set goodreads id --- .../Books/Calibre/CalibreProxy.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/NzbDrone.Core/Books/Calibre/CalibreProxy.cs b/src/NzbDrone.Core/Books/Calibre/CalibreProxy.cs index efdf311d5..c1432e5a2 100644 --- a/src/NzbDrone.Core/Books/Calibre/CalibreProxy.cs +++ b/src/NzbDrone.Core/Books/Calibre/CalibreProxy.cs @@ -117,13 +117,13 @@ namespace NzbDrone.Core.Books.Calibre public void SetFields(BookFile file, CalibreSettings settings) { - var book = file.Edition.Value; + var edition = file.Edition.Value; - var cover = book.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Cover); + var cover = edition.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Cover); string image = null; if (cover != null) { - var imageFile = _mediaCoverService.GetCoverPath(book.Id, MediaCoverEntity.Book, cover.CoverType, cover.Extension, null); + var imageFile = _mediaCoverService.GetCoverPath(edition.BookId, MediaCoverEntity.Book, cover.CoverType, cover.Extension, null); if (File.Exists(imageFile)) { @@ -136,16 +136,17 @@ namespace NzbDrone.Core.Books.Calibre { changes = new { - title = book.Title, + title = edition.Title, authors = new[] { file.Author.Value.Name }, cover = image, - pubdate = book.ReleaseDate, - comments = book.Overview, - rating = book.Ratings.Value * 2, + pubdate = edition.Book.Value.ReleaseDate, + comments = edition.Overview, + rating = edition.Ratings.Value * 2, identifiers = new Dictionary { - { "isbn", book.Isbn13 }, - { "asin", book.Asin } + { "isbn", edition.Isbn13 }, + { "asin", edition.Asin }, + { "goodreads", edition.ForeignEditionId } } }, loaded_book_ids = new[] { file.CalibreId }