Fixed breaking error when there was no rating
This commit is contained in:
parent
4968c491dc
commit
34f6353630
1 changed files with 1 additions and 1 deletions
|
|
@ -73,7 +73,7 @@ export class OpenLibraryAPI extends APIModel {
|
|||
|
||||
author: result.author_name ?? 'unknown',
|
||||
pages: result.number_of_pages_median ?? 'unknown',
|
||||
onlineRating: Number.parseFloat(result.ratings_average.toFixed(2)) ?? 0,
|
||||
onlineRating: Number.parseFloat(Number(result.ratings_average ?? 0).toFixed(2)),
|
||||
image: `https://covers.openlibrary.org/b/OLID/` + result.cover_edition_key + `-L.jpg` ?? '',
|
||||
|
||||
released: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue