[jm] fix comment page count

This commit is contained in:
2025-03-25 15:22:51 +08:00
parent 0aeb725bc8
commit aa96fef8fb
2 changed files with 4 additions and 3 deletions

View File

@@ -45,6 +45,6 @@
"name": "禁漫天堂", "name": "禁漫天堂",
"fileName": "jm.js", "fileName": "jm.js",
"key": "jm", "key": "jm",
"version": "1.1.3" "version": "1.1.4"
} }
] ]

5
jm.js
View File

@@ -7,7 +7,7 @@ class JM extends ComicSource {
// unique id of the source // unique id of the source
key = "jm" key = "jm"
version = "1.1.3" version = "1.1.4"
minAppVersion = "1.2.5" minAppVersion = "1.2.5"
@@ -790,6 +790,7 @@ class JM extends ComicSource {
loadComments: async (comicId, subId, page, replyTo) => { loadComments: async (comicId, subId, page, replyTo) => {
let res = await this.get(`${this.baseUrl}/forum?mode=manhua&aid=${comicId}&page=${page}`) let res = await this.get(`${this.baseUrl}/forum?mode=manhua&aid=${comicId}&page=${page}`)
let json = JSON.parse(res) let json = JSON.parse(res)
const pageSize = 6
return { return {
comments: json.list.map((e) => new Comment({ comments: json.list.map((e) => new Comment({
avatar: this.getAvatarUrl(e.photo), avatar: this.getAvatarUrl(e.photo),
@@ -797,7 +798,7 @@ class JM extends ComicSource {
time: e.addtime, time: e.addtime,
content: e.content.substring(e.content.indexOf('>') + 1, e.content.lastIndexOf('<')), content: e.content.substring(e.content.indexOf('>') + 1, e.content.lastIndexOf('<')),
})), })),
maxPage: Number(json.total.toString()) maxPage: Math.floor(json.total / pageSize) + 1
} }
}, },
/** /**