Added isbn13 as well

This commit is contained in:
ltctceplrm 2023-12-19 20:39:26 +01:00
parent fe9f04126d
commit d21ac66061
2 changed files with 4 additions and 1 deletions

View file

@ -69,7 +69,8 @@ export class OpenLibraryAPI extends APIModel {
dataSource: this.apiName,
url: `https://openlibrary.org` + result.key,
id: result.key,
isbn: result.isbn[0] ?? 'unknown',
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',

View file

@ -10,6 +10,7 @@ export class BookModel extends MediaTypeModel {
onlineRating: number;
english_title: string;
isbn: number;
isbn13: number;
released: boolean;
@ -27,6 +28,7 @@ export class BookModel extends MediaTypeModel {
this.image = undefined;
this.onlineRating = undefined;
this.isbn = undefined;
this.isbn13 = undefined;
this.released = undefined;