Merge pull request #116 from ltctceplrm/master
Added isbn and isbn13 fields to books + included author name in the search results
This commit is contained in:
commit
1424c0cef6
2 changed files with 8 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ export class OpenLibraryAPI extends APIModel {
|
|||
year: result.first_publish_year,
|
||||
dataSource: this.apiName,
|
||||
id: result.key,
|
||||
author: result.author_name ?? 'unknown',
|
||||
} as BookModel),
|
||||
);
|
||||
}
|
||||
|
|
@ -69,6 +70,8 @@ export class OpenLibraryAPI extends APIModel {
|
|||
dataSource: this.apiName,
|
||||
url: `https://openlibrary.org` + result.key,
|
||||
id: result.key,
|
||||
isbn: result.isbn.find((el: string | any[]) => el.length <= 10) ?? 'unknown',
|
||||
isbn13: result.isbn.find((el: string | any[]) => el.length == 13) ?? 'unknown',
|
||||
englishTitle: result.title_english ?? result.title,
|
||||
|
||||
author: result.author_name ?? 'unknown',
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ export class BookModel extends MediaTypeModel {
|
|||
image: string;
|
||||
onlineRating: number;
|
||||
english_title: string;
|
||||
isbn: number;
|
||||
isbn13: number;
|
||||
|
||||
released: boolean;
|
||||
|
||||
|
|
@ -25,6 +27,8 @@ export class BookModel extends MediaTypeModel {
|
|||
this.pages = undefined;
|
||||
this.image = undefined;
|
||||
this.onlineRating = undefined;
|
||||
this.isbn = undefined;
|
||||
this.isbn13 = undefined;
|
||||
|
||||
this.released = undefined;
|
||||
|
||||
|
|
@ -52,6 +56,6 @@ export class BookModel extends MediaTypeModel {
|
|||
}
|
||||
|
||||
getSummary(): string {
|
||||
return this.englishTitle + ' (' + this.year + ')';
|
||||
return this.englishTitle + ' (' + this.year + ') - ' + this.author;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue