aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-08-29 17:38:13 -0700
committerFuwn <[email protected]>2023-08-29 17:38:20 -0700
commit98d4d60b2246f02d8e651d97a3b6468b3bfa89f3 (patch)
treed2d442c460a51b850d60f61e9e0d8701cf2feae6 /src
parentfix(settings): descriptions (diff)
downloaddue.moe-98d4d60b2246f02d8e651d97a3b6468b3bfa89f3.tar.xz
due.moe-98d4d60b2246f02d8e651d97a3b6468b3bfa89f3.zip
fix(mangadex): 0 progress chapter counts
Diffstat (limited to 'src')
-rw-r--r--src/lib/mangadex.ts8
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'];