Skip to content

Commit d21ac66

Browse files
committed
Added isbn13 as well
1 parent fe9f041 commit d21ac66

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/api/apis/OpenLibraryAPI.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ export class OpenLibraryAPI extends APIModel {
6969
dataSource: this.apiName,
7070
url: `https://openlibrary.org` + result.key,
7171
id: result.key,
72-
isbn: result.isbn[0] ?? 'unknown',
72+
isbn: result.isbn.find((el: string | any[]) => el.length <= 10) ?? 'unknown',
73+
isbn13: result.isbn.find((el: string | any[]) => el.length == 13) ?? 'unknown',
7374
englishTitle: result.title_english ?? result.title,
7475

7576
author: result.author_name ?? 'unknown',

src/models/BookModel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export class BookModel extends MediaTypeModel {
1010
onlineRating: number;
1111
english_title: string;
1212
isbn: number;
13+
isbn13: number;
1314

1415
released: boolean;
1516

@@ -27,6 +28,7 @@ export class BookModel extends MediaTypeModel {
2728
this.image = undefined;
2829
this.onlineRating = undefined;
2930
this.isbn = undefined;
31+
this.isbn13 = undefined;
3032

3133
this.released = undefined;
3234

0 commit comments

Comments
 (0)