feat: add book images

This commit is contained in:
Cory Dransfeldt 2023-06-03 20:01:05 -07:00
parent b7a56263b6
commit d15d4e00ab
No known key found for this signature in database
6 changed files with 91 additions and 84 deletions

View file

@ -6,7 +6,13 @@ module.exports = async function () {
// noinspection JSCheckFunctionSignatures
const asset = new AssetCache('books_data')
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
const res = await extract(url)
const res = await extract(url, {
getExtraEntryFields: (feedEntry) => {
return {
image: feedEntry['oku:cover'] || 'https://cdn.coryd.dev/books/missing-book.jpg',
}
},
})
.catch((error) => {
console.log(error.message)
})