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