mirror of
https://github.com/Readarr/Readarr
synced 2026-01-17 04:53:26 +01:00
Fixed: Send correct covers to Goodreads
Also use original release date and set goodreads id
This commit is contained in:
parent
15f9ae3c13
commit
9e5966365c
1 changed files with 10 additions and 9 deletions
|
|
@ -117,13 +117,13 @@ public void RemoveFormats(int calibreId, IEnumerable<string> formats, CalibreSet
|
|||
|
||||
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 @@ public void SetFields(BookFile file, CalibreSettings settings)
|
|||
{
|
||||
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<string, string>
|
||||
{
|
||||
{ "isbn", book.Isbn13 },
|
||||
{ "asin", book.Asin }
|
||||
{ "isbn", edition.Isbn13 },
|
||||
{ "asin", edition.Asin },
|
||||
{ "goodreads", edition.ForeignEditionId }
|
||||
}
|
||||
},
|
||||
loaded_book_ids = new[] { file.CalibreId }
|
||||
|
|
|
|||
Loading…
Reference in a new issue