diff options
| author | Fuwn <[email protected]> | 2023-08-29 17:38:13 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-08-29 17:38:20 -0700 |
| commit | 98d4d60b2246f02d8e651d97a3b6468b3bfa89f3 (patch) | |
| tree | d2d442c460a51b850d60f61e9e0d8701cf2feae6 /src | |
| parent | fix(settings): descriptions (diff) | |
| download | due.moe-98d4d60b2246f02d8e651d97a3b6468b3bfa89f3.tar.xz due.moe-98d4d60b2246f02d8e651d97a3b6468b3bfa89f3.zip | |
fix(mangadex): 0 progress chapter counts
Diffstat (limited to 'src')
| -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']; |