diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/mangadex.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/mangadex.ts b/src/lib/mangadex.ts index 45251a4d..9ab65d75 100644 --- a/src/lib/mangadex.ts +++ b/src/lib/mangadex.ts @@ -38,8 +38,12 @@ export const chapterCount = async (manga: Media): Promise<number | null> => { let lastChapterIndex = 0; - while (lastChapterData['data'][lastChapterIndex]['attributes']['translatedLanguage'] !== 'en') { - lastChapterIndex += 1; + for (let i = 0; i < lastChapterData['data'].length; i++) { + if (lastChapterData['data'][i]['attributes']['volume'] !== null) { + lastChapterIndex = i; + + break; + } } let lastChapter = lastChapterData['data'][lastChapterIndex]['attributes']['chapter']; |