fix zeroscans (#554)

This commit is contained in:
Carlos 2018-10-14 12:44:11 -04:00 committed by GitHub
parent 5e861d3c4f
commit fd65549eb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -5,8 +5,8 @@ ext {
appName = 'Tachiyomi: WPManga (Many sources)' appName = 'Tachiyomi: WPManga (Many sources)'
pkgNameSuffix = 'all.wpmanga' pkgNameSuffix = 'all.wpmanga'
extClass = '.WpMangaFactory' extClass = '.WpMangaFactory'
extVersionCode = 2 extVersionCode = 3
extVersionSuffix = 2 extVersionSuffix = 3
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -97,12 +97,20 @@ open class WpManga(override val name: String, override val baseUrl: String, over
val urlElement = element.select("a").first() val urlElement = element.select("a").first()
val dateElement = element.select("span").first() val dateElement = element.select("span").first()
val chapter = SChapter.create() val chapter = SChapter.create()
chapter.setUrlWithoutDomain(urlElement.attr("href") + "?style=list") chapter.setUrlWithoutDomain(getUrl(urlElement))
chapter.name = urlElement.text() chapter.name = urlElement.text()
chapter.date_upload = dateElement.text()?.let { parseChapterDate(it) } ?: 0 chapter.date_upload = dateElement.text()?.let { parseChapterDate(it) } ?: 0
return chapter return chapter
} }
private fun getUrl(urlElement: Element): String {
var url = urlElement.attr("href")
return when {
url.endsWith("?style=list") -> url
else -> "$url?style=list"
}
}
open fun parseChapterDate(date: String): Long? { open fun parseChapterDate(date: String): Long? {
val lcDate = date.toLowerCase() val lcDate = date.toLowerCase()
if (lcDate.endsWith(" ago")) if (lcDate.endsWith(" ago"))
@ -165,7 +173,7 @@ open class WpManga(override val name: String, override val baseUrl: String, over
} }
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
val doc = document.select("div.page-break img"); val doc = document.select("div.page-break img")
val pages = mutableListOf<Page>() val pages = mutableListOf<Page>()
doc.forEach { doc.forEach {