aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-08-29 13:09:54 -0700
committerFuwn <[email protected]>2023-08-29 13:09:54 -0700
commit62d61e373d3f37fd71ebe0a8c32721f9b79af8b9 (patch)
tree2b9c3e9de561b34b581030c7e36b8d8a162ba5d2 /src
parentfix(app.html): png image (diff)
downloaddue.moe-62d61e373d3f37fd71ebe0a8c32721f9b79af8b9.tar.xz
due.moe-62d61e373d3f37fd71ebe0a8c32721f9b79af8b9.zip
fix(mangadex): only count english chapters
Improves chapter count accuracy by a lot!
Diffstat (limited to 'src')
-rw-r--r--src/app.html11
-rw-r--r--src/lib/mangadex.ts8
2 files changed, 14 insertions, 5 deletions
diff --git a/src/app.html b/src/app.html
index c2d4576c..2ad032b3 100644
--- a/src/app.html
+++ b/src/app.html
@@ -3,10 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
- <meta content="期限" property="og:title">
- <meta content="due.moe" property="og:site_name">
- <meta content="Instantly view which anime & manga on your lists have new episodes/chapters!" property="og:description">
- <meta content="https://due.moe/favicon.png" property="og:image">
+ <meta content="期限" property="og:title" />
+ <meta content="due.moe" property="og:site_name" />
+ <meta
+ content="Instantly view which anime & manga on your lists have new episodes/chapters!"
+ property="og:description"
+ />
+ <meta content="https://due.moe/favicon.png" property="og:image" />
<title>期限</title>
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;