Fixed bug in OpenLibraryAPI when no isbn was present

This commit is contained in:
ltctceplrm 2024-01-14 18:19:26 +01:00 committed by GitHub
parent 8bb8c2d791
commit 99bf06dda9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,8 +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',
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',