Baozi Manhua: chapter image pagination overlap (#12703)
This commit is contained in:
parent
69aec03657
commit
1fe1da7b02
|
@ -1,3 +1,7 @@
|
||||||
|
## 1.3.12 (2022-07-23)
|
||||||
|
|
||||||
|
- 适配章节分页的重叠区域,修复图片重复、缺页的问题
|
||||||
|
|
||||||
## 1.3.11 (2022-07-21)
|
## 1.3.11 (2022-07-21)
|
||||||
|
|
||||||
- 增加设置项:修复章节顺序错误导致的错标已读
|
- 增加设置项:修复章节顺序错误导致的错标已读
|
||||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'Baozi Manhua'
|
extName = 'Baozi Manhua'
|
||||||
pkgNameSuffix = 'zh.baozimanhua'
|
pkgNameSuffix = 'zh.baozimanhua'
|
||||||
extClass = '.Baozi'
|
extClass = '.Baozi'
|
||||||
extVersionCode = 11
|
extVersionCode = 12
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -133,6 +133,7 @@ class Baozi : ParsedHttpSource(), ConfigurableSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun fetchPageList(chapter: SChapter): Observable<List<Page>> = Single.create<List<Page>> {
|
override fun fetchPageList(chapter: SChapter): Observable<List<Page>> = Single.create<List<Page>> {
|
||||||
|
val pageNumberSelector = Evaluator.Class("comic-text__amp")
|
||||||
val pageList = ArrayList<Page>(0)
|
val pageList = ArrayList<Page>(0)
|
||||||
var url = baseUrl + chapter.url
|
var url = baseUrl + chapter.url
|
||||||
var pageCount = 0
|
var pageCount = 0
|
||||||
|
@ -140,11 +141,13 @@ class Baozi : ParsedHttpSource(), ConfigurableSource {
|
||||||
do {
|
do {
|
||||||
val document = client.newCall(GET(url, headers)).execute().asJsoup()
|
val document = client.newCall(GET(url, headers)).execute().asJsoup()
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
pageCount = document.selectFirst(Evaluator.Class("comic-text__amp"))
|
pageCount = document.selectFirst(pageNumberSelector)
|
||||||
?.run { text().substringAfter('/').toInt() } ?: break
|
?.run { text().substringAfter('/').toInt() } ?: break
|
||||||
pageList.ensureCapacity(pageCount)
|
pageList.ensureCapacity(pageCount)
|
||||||
}
|
}
|
||||||
document.select(".comic-contain amp-img").mapTo(pageList) { element ->
|
document.select(".comic-contain amp-img").dropWhile { element ->
|
||||||
|
element.selectFirst(pageNumberSelector).text().substringBefore('/').toInt() <= i
|
||||||
|
}.mapTo(pageList) { element ->
|
||||||
Page(i++, imageUrl = element.attr("src"))
|
Page(i++, imageUrl = element.attr("src"))
|
||||||
}
|
}
|
||||||
url = document.selectFirst(Evaluator.Id("next-chapter"))?.attr("href") ?: break
|
url = document.selectFirst(Evaluator.Id("next-chapter"))?.attr("href") ?: break
|
||||||
|
|
Loading…
Reference in New Issue