fix: book data
This commit is contained in:
parent
51d2a1c7d9
commit
b7a955a3ab
2 changed files with 6 additions and 7 deletions
|
@ -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')
|
||||
}
|
||||
|
|
Reference in a new issue