Fixed: Sort authors by lastname, firstname

This commit is contained in:
ta264
2021-05-13 21:31:46 +01:00
parent 62221c2a7f
commit 96db74494a
26 changed files with 279 additions and 27 deletions
@@ -109,7 +109,6 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
Metadata = MapAuthor(resource)
};
author.CleanName = Parser.Parser.CleanAuthorName(author.Metadata.Value.Name);
author.SortName = Parser.Parser.NormalizeTitle(author.Metadata.Value.Name);
// we can only get a rating from the author list page...
var listResource = GetAuthorBooksPageResource(foreignAuthorId, 10, 1);
@@ -532,6 +531,8 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
Status = resource.DiedOnDate < DateTime.UtcNow ? AuthorStatusType.Ended : AuthorStatusType.Continuing
};
author.SortName = author.Name.ToSortName().ToLower();
if (!NoPhotoRegex.IsMatch(resource.LargeImageUrl))
{
author.Images.Add(new MediaCover.MediaCover
@@ -555,6 +556,8 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
TitleSlug = resource.Id.ToString()
};
author.SortName = author.Name.ToSortName().ToLower();
if (resource.RatingsCount.HasValue)
{
author.Ratings = new Ratings
@@ -704,6 +707,7 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
{
ForeignAuthorId = resource.BestBook.AuthorId.ToString(),
Name = resource.BestBook.AuthorName,
SortName = resource.BestBook.AuthorName.ToSortName().ToLower(),
TitleSlug = resource.BestBook.AuthorId.ToString()
}
};