Add genres again
This commit is contained in:
parent
29f2c58703
commit
f03e3bf442
1 changed files with 3 additions and 1 deletions
|
|
@ -29,6 +29,7 @@ interface SearchResponse {
|
||||||
first_publish_year?: number;
|
first_publish_year?: number;
|
||||||
key: string;
|
key: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
subject?: string[];
|
||||||
|
|
||||||
number_of_pages_median?: number;
|
number_of_pages_median?: number;
|
||||||
isbn?: string[];
|
isbn?: string[];
|
||||||
|
|
@ -119,7 +120,7 @@ export class OpenLibraryAPI extends APIModel {
|
||||||
params: {
|
params: {
|
||||||
query: {
|
query: {
|
||||||
q: `${id}`,
|
q: `${id}`,
|
||||||
fields: 'key,title,author_name,number_of_pages_median,first_publish_year,isbn,ratings_score,first_sentence,title_suggest,rating*,cover*,editions,description',
|
fields: 'key,title,author_name,number_of_pages_median,first_publish_year,isbn,ratings_score,first_sentence,title_suggest,rating*,cover*,editions,description,subject',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
fetch: obsidianFetch,
|
fetch: obsidianFetch,
|
||||||
|
|
@ -194,6 +195,7 @@ export class OpenLibraryAPI extends APIModel {
|
||||||
|
|
||||||
author: result.author_name?.join(', '),
|
author: result.author_name?.join(', '),
|
||||||
plot: result.description ?? undefined,
|
plot: result.description ?? undefined,
|
||||||
|
genres: result.subject ?? undefined,
|
||||||
pages: Number.isNaN(pages) ? undefined : pages,
|
pages: Number.isNaN(pages) ? undefined : pages,
|
||||||
onlineRating: result.ratings_average,
|
onlineRating: result.ratings_average,
|
||||||
image: cover_i ? `https://covers.openlibrary.org/b/id/` + cover_i + `-L.jpg` : undefined,
|
image: cover_i ? `https://covers.openlibrary.org/b/id/` + cover_i + `-L.jpg` : undefined,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue