fix wnacg search

This commit is contained in:
2024-11-18 17:29:05 +08:00
parent 9c021a8248
commit ba0edb50f3
2 changed files with 5 additions and 4 deletions

View File

@@ -39,7 +39,7 @@
"name": "紳士漫畫", "name": "紳士漫畫",
"fileName": "wnacg.js", "fileName": "wnacg.js",
"key": "wnacg", "key": "wnacg",
"version": "1.0.1" "version": "1.0.2"
}, },
{ {
"name": "ehentai", "name": "ehentai",

View File

@@ -7,7 +7,7 @@ class Wnacg extends ComicSource {
// unique id of the source // unique id of the source
key = "wnacg" key = "wnacg"
version = "1.0.1" version = "1.0.2"
minAppVersion = "1.0.0" minAppVersion = "1.0.0"
@@ -342,8 +342,9 @@ class Wnacg extends ComicSource {
for (let comicElement of comicElements) { for (let comicElement of comicElements) {
comics.push(this.parseComic(comicElement)) comics.push(this.parseComic(comicElement))
} }
let total = document.querySelectorAll("p.result > b")[0].text.match(/\d+/) let total = document.querySelectorAll("p.result > b")[0].text.replaceAll(',', '')
let pages = Math.ceil(Number(total) / 24) const comicsPerPage = 24
let pages = Math.ceil(Number(total) / comicsPerPage)
document.dispose() document.dispose()
return { return {
comics: comics, comics: comics,