diff --git a/src/all/wpmanga/build.gradle b/src/all/wpmanga/build.gradle index dc6bd1211..f035e3ec5 100644 --- a/src/all/wpmanga/build.gradle +++ b/src/all/wpmanga/build.gradle @@ -5,8 +5,8 @@ ext { appName = 'Tachiyomi: WPManga (Many sources)' pkgNameSuffix = 'all.wpmanga' extClass = '.WpMangaFactory' - extVersionCode = 2 - extVersionSuffix = 2 + extVersionCode = 3 + extVersionSuffix = 3 libVersion = '1.2' } diff --git a/src/all/wpmanga/src/eu/kanade/tachiyomi/extension/all/wpmanga/WpManga.kt b/src/all/wpmanga/src/eu/kanade/tachiyomi/extension/all/wpmanga/WpManga.kt index a3432e4cc..7060ec834 100644 --- a/src/all/wpmanga/src/eu/kanade/tachiyomi/extension/all/wpmanga/WpManga.kt +++ b/src/all/wpmanga/src/eu/kanade/tachiyomi/extension/all/wpmanga/WpManga.kt @@ -97,12 +97,20 @@ open class WpManga(override val name: String, override val baseUrl: String, over val urlElement = element.select("a").first() val dateElement = element.select("span").first() val chapter = SChapter.create() - chapter.setUrlWithoutDomain(urlElement.attr("href") + "?style=list") + chapter.setUrlWithoutDomain(getUrl(urlElement)) chapter.name = urlElement.text() chapter.date_upload = dateElement.text()?.let { parseChapterDate(it) } ?: 0 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? { val lcDate = date.toLowerCase() 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 { - val doc = document.select("div.page-break img"); + val doc = document.select("div.page-break img") val pages = mutableListOf() doc.forEach {