mirror of
https://github.com/Readarr/Readarr
synced 2026-02-01 12:23:01 +01:00
Fixed: Error adding some authors
Fixes the case where the author wasn't the main contributor to their most popular book Fixes #42 Fixes #360
This commit is contained in:
parent
be83bff893
commit
412a2dcb6f
1 changed files with 3 additions and 3 deletions
|
|
@ -113,11 +113,11 @@ public Author GetAuthorInfo(string foreignAuthorId)
|
|||
|
||||
// we can only get a rating from the author list page...
|
||||
var listResource = GetAuthorBooksPageResource(foreignAuthorId, 10, 1);
|
||||
var authorResource = listResource.List.First().Authors.First(a => a.Id.ToString() == foreignAuthorId);
|
||||
var authorResource = listResource.List.SelectMany(x => x.Authors).FirstOrDefault(a => a.Id.ToString() == foreignAuthorId);
|
||||
author.Metadata.Value.Ratings = new Ratings
|
||||
{
|
||||
Votes = authorResource.RatingsCount ?? 0,
|
||||
Value = authorResource.AverageRating ?? 0
|
||||
Votes = authorResource?.RatingsCount ?? 0,
|
||||
Value = authorResource?.AverageRating ?? 0
|
||||
};
|
||||
|
||||
return author;
|
||||
|
|
|
|||
Loading…
Reference in a new issue