fixed book loading on anilist entries
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user