Merge pull request #275 from ltctceplrm/isbn-fix

Change isbns to strings
This commit is contained in:
Moritz Jung 2026-06-17 09:43:06 +02:00 committed by GitHub
commit 5833ca261f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 10 deletions

View file

@ -184,8 +184,8 @@ export class OpenLibraryAPI extends APIModel {
genres: result.subject,
pages: result.number_of_pages_median ?? result.number_of_pages,
onlineRating: result.ratings_average,
isbn: isbn10 ? Number(isbn10) : undefined,
isbn13: isbn13 ? Number(isbn13) : undefined,
isbn: isbn10,
isbn13: isbn13,
image: result.cover_i ? `https://covers.openlibrary.org/b/id/${result.cover_i}-L.jpg` : undefined,
released: true,
userData: {
@ -255,8 +255,8 @@ export class OpenLibraryAPI extends APIModel {
dataSource: this.apiName,
url: `https://openlibrary.org${bookKey}`,
id: bookKey,
isbn: bookIsbn10 ? Number(bookIsbn10) : searchIsbn10 ? Number(searchIsbn10) : undefined,
isbn13: bookIsbn13 ? Number(bookIsbn13) : searchIsbn13 ? Number(searchIsbn13) : undefined,
isbn: bookIsbn10 ?? searchIsbn10,
isbn13: bookIsbn13 ?? searchIsbn13,
author: search?.author_name?.join(', '),
plot: this.pickDescription(search?.description),
genres: search?.subject,
@ -328,8 +328,8 @@ export class OpenLibraryAPI extends APIModel {
dataSource: this.apiName,
id: result.key ?? query,
url: result.key ? `https://openlibrary.org${result.key}` : undefined,
isbn: isbn10 ? Number(isbn10) : undefined,
isbn13: isbn13 ? Number(isbn13) : undefined,
isbn: isbn10,
isbn13: isbn13,
author: result.author_name?.join(', '),
plot: this.pickDescription(result.description),
genres: result.subject,

View file

@ -12,8 +12,8 @@ export class BookModel extends MediaTypeModel {
pages: number;
image: string;
onlineRating: number;
isbn: number;
isbn13: number;
isbn: string;
isbn13: string;
released: boolean;
@ -32,8 +32,8 @@ export class BookModel extends MediaTypeModel {
this.pages = 0;
this.image = '';
this.onlineRating = 0;
this.isbn = 0;
this.isbn13 = 0;
this.isbn = '';
this.isbn13 = '';
this.released = false;