mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-29 01:58:49 +01:00
Update:Select largest cover image from Google Books provider #1244
This commit is contained in:
parent
4fcdeda447
commit
a68ade2b3d
@ -15,7 +15,13 @@ class GoogleBooks {
|
||||
cleanResult(item) {
|
||||
var { id, volumeInfo } = item
|
||||
if (!volumeInfo) return null
|
||||
var { title, subtitle, authors, publisher, publisherDate, description, industryIdentifiers, categories, imageLinks } = volumeInfo
|
||||
const { title, subtitle, authors, publisher, publisherDate, description, industryIdentifiers, categories, imageLinks } = volumeInfo
|
||||
|
||||
let cover = null
|
||||
// Selects the largest cover assuming the largest is the last key in the object
|
||||
if (imageLinks && Object.keys(imageLinks).length) {
|
||||
cover = imageLinks[Object.keys(imageLinks).pop()] || null
|
||||
}
|
||||
|
||||
return {
|
||||
id,
|
||||
@ -25,7 +31,7 @@ class GoogleBooks {
|
||||
publisher,
|
||||
publishedYear: publisherDate ? publisherDate.split('-')[0] : null,
|
||||
description,
|
||||
cover: imageLinks && imageLinks.thumbnail ? imageLinks.thumbnail : null,
|
||||
cover,
|
||||
genres: categories && Array.isArray(categories) ? [...categories] : null,
|
||||
isbn: this.extractIsbn(industryIdentifiers)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user