From 2cad7ff6ea86fcc7c5d477314c07f6837e95505d Mon Sep 17 00:00:00 2001 From: lenafx Date: Wed, 3 Dec 2025 00:39:49 +0100 Subject: [PATCH] fixed book loading on anilist entries --- src/books/books.service.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/books/books.service.ts b/src/books/books.service.ts index cc67874..e83c2ab 100644 --- a/src/books/books.service.ts +++ b/src/books/books.service.ts @@ -271,10 +271,9 @@ export async function getChaptersForBook(id: string): Promise<{ chapters: Chapte let searchTitle: string = ""; if (!isNaN(Number(id))) { - bookData = await fetchBookMetadata(id); - if (!bookData) { - return { chapters: [] }; - } + const result = await getBookById(id); + if (!result || "error" in result) return { chapters: [] } + bookData = result; const titles = [bookData.title.english, bookData.title.romaji].filter(Boolean) as string[]; searchTitle = titles[0]; }