fix mangadex search and search paging (#300)

This commit is contained in:
Carlos 2018-04-17 22:43:42 -04:00 committed by GitHub
parent 3fc0f72436
commit bd35a411eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -5,8 +5,8 @@ ext {
appName = 'Tachiyomi: MangaDex'
pkgNameSuffix = "all.mangadex"
extClass = '.MangadexFactory'
extVersionCode = 18
extVersionSuffix = 18
extVersionCode = 19
extVersionSuffix = 19
libVersion = '1.2'
}

View File

@ -141,7 +141,7 @@ open class Mangadex(override val lang: String, private val internalLang: String,
} else {
//do traditional search
val url = HttpUrl.parse("$baseUrl/?page=search")!!.newBuilder().addQueryParameter("title", query)
val url = HttpUrl.parse("$baseUrl/?page=search")!!.newBuilder().addQueryParameter("p", page.toString()).addQueryParameter("title", query)
filters.forEach { filter ->
when (filter) {
is TextField -> url.addQueryParameter(filter.key, filter.state)
@ -153,11 +153,11 @@ open class Mangadex(override val lang: String, private val internalLang: String,
}
}
override fun searchMangaSelector() = ".table.table-striped.table-hover.table-condensed tbody tr"
override fun searchMangaSelector() = "div.col-sm-6"
override fun searchMangaFromElement(element: Element): SManga {
val manga = SManga.create()
element.select("a[href*=manga]").first().let {
element.select("a.manga_title").first().let {
val url = removeMangaNameFromUrl(it.attr("href"))
manga.setUrlWithoutDomain(url)
manga.thumbnail_url = baseUrl + "/images" + manga.url.substringBeforeLast("/") + ".jpg"