diff --git a/Source/DataLayer/EntityExtensions.cs b/Source/DataLayer/EntityExtensions.cs index ef18a232..acf0b866 100644 --- a/Source/DataLayer/EntityExtensions.cs +++ b/Source/DataLayer/EntityExtensions.cs @@ -93,10 +93,12 @@ namespace DataLayer var starString = new string(STAR, fullStars); - if (score - fullStars >= 0.25f) - starString += HALF; + if (score - fullStars >= 0.75f) + starString += STAR; + else if (score - fullStars >= 0.25f) + starString += HALF; - return starString; + return starString; } } } diff --git a/Source/DtoImporterService/BookImporter.cs b/Source/DtoImporterService/BookImporter.cs index 6b884673..d9de490c 100644 --- a/Source/DtoImporterService/BookImporter.cs +++ b/Source/DtoImporterService/BookImporter.cs @@ -174,7 +174,10 @@ namespace DtoImporterService if (item.PictureLarge is not null) book.PictureLarge = item.PictureLarge; - book.UpdateProductRating(item.Product_OverallStars, item.Product_PerformanceStars, item.Product_StoryStars); + book.UpdateProductRating( + (float)(item.Rating?.OverallDistribution?.AverageRating ?? 0), + (float)(item.Rating?.PerformanceDistribution?.AverageRating ?? 0), + (float)(item.Rating?.StoryDistribution?.AverageRating ?? 0)); // important to update user-specific info. this will have changed if user has rated/reviewed the book since last library import book.UserDefinedItem.UpdateRating(item.MyUserRating_Overall, item.MyUserRating_Performance, item.MyUserRating_Story);