fix: book data

This commit is contained in:
Cory Dransfeldt 2023-07-08 20:06:53 -07:00
parent 51d2a1c7d9
commit b7a955a3ab
No known key found for this signature in database
2 changed files with 6 additions and 7 deletions

View file

@ -1,14 +1,15 @@
const reading = require('./json/read.json')
module.exports = async function () {
return reading.map(read => {
if (read.status === 'started') return {
const books = reading.map(read => {
return {
title: read.title,
author: read.authors.length > 1 ? read.authors.join(', ') : read.authors.pop(),
cover: read.thumbnail.replace('https://books.google.com', 'https://books.coryd.dev'),
link: `https://openlibrary.org/search?q=${read.isbn}`,
started: read.dateStarted,
finished: read.dateFinished
finished: read.dateFinished,
status: read.status,
}
})
return books.filter(book => book.status === 'started')
}