Skip to content

Commit

Permalink
Pass through image
Browse files Browse the repository at this point in the history
  • Loading branch information
katydecorah committed Jun 20, 2024
1 parent 568801a commit 1b6d92e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50834,12 +50834,13 @@ function formatBooks({ bookKeyName, bookData, start, end }) {
: [];
const books = filterData(bookData, "dateFinished", start, end)
.filter((book) => { var _a; return !((_a = book.tags) === null || _a === void 0 ? void 0 : _a.includes("hide")); })
.map(({ title, authors, link, isbn, tags }) => {
.map(({ title, authors, link, isbn, tags, image }) => {
tags =
bookTags.length > 0
? tags === null || tags === void 0 ? void 0 : tags.filter((tag) => bookTags.includes(tag))
: [];
return Object.assign({ title, authors: authors.join(", "), url: link, isbn }, ((tags === null || tags === void 0 ? void 0 : tags.length) && { tags }));
return Object.assign({ title, authors: authors.join(", "), url: link, image,
isbn }, ((tags === null || tags === void 0 ? void 0 : tags.length) && { tags }));
});
return {
bookYaml: dump({ [bookKeyName]: books }),
Expand Down
3 changes: 2 additions & 1 deletion src/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function formatBooks({ bookKeyName, bookData, start, end }) {

const books: Book[] = filterData(bookData, "dateFinished", start, end)
.filter((book) => !book.tags?.includes("hide"))
.map(({ title, authors, link, isbn, tags }) => {
.map(({ title, authors, link, isbn, tags, image }) => {
tags =
bookTags.length > 0
? tags?.filter((tag) => bookTags.includes(tag))
Expand All @@ -25,6 +25,7 @@ export function formatBooks({ bookKeyName, bookData, start, end }) {
title,
authors: authors.join(", "),
url: link,
image,
isbn,
...(tags?.length && { tags }),
};
Expand Down

0 comments on commit 1b6d92e

Please sign in to comment.