Update GoogleBooks.js

Further updated to check for extraLarge, then fallback to Large then to thumbnail and then to null if not available.
This commit is contained in:
Andrew Hampton 2022-12-05 12:38:01 -07:00 committed by GitHub
parent 67db41a525
commit 2f578004e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ class GoogleBooks {
publisher, publisher,
publishedYear: publisherDate ? publisherDate.split('-')[0] : null, publishedYear: publisherDate ? publisherDate.split('-')[0] : null,
description, description,
cover: imageLinks && imageLinks.thumbnail ? imageLinks.thumbnail : null, cover: imageLinks && imageLinks.extraLarge ? image.extraLarge : image.imagelarge ? Links.thumbnail ? imageLinks.thumbnail : null,
genres: categories && Array.isArray(categories) ? [...categories] : null, genres: categories && Array.isArray(categories) ? [...categories] : null,
isbn: this.extractIsbn(industryIdentifiers) isbn: this.extractIsbn(industryIdentifiers)
} }
@ -51,4 +51,4 @@ class GoogleBooks {
} }
} }
module.exports = GoogleBooks module.exports = GoogleBooks