From bd35a411eb6606a060edaa1ae88eadfce7def867 Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 17 Apr 2018 22:43:42 -0400 Subject: [PATCH] fix mangadex search and search paging (#300) --- src/all/mangadex/build.gradle | 4 ++-- .../eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index 04f6a6c30..4b45195dd 100644 --- a/src/all/mangadex/build.gradle +++ b/src/all/mangadex/build.gradle @@ -5,8 +5,8 @@ ext { appName = 'Tachiyomi: MangaDex' pkgNameSuffix = "all.mangadex" extClass = '.MangadexFactory' - extVersionCode = 18 - extVersionSuffix = 18 + extVersionCode = 19 + extVersionSuffix = 19 libVersion = '1.2' } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt index 976255f61..be019a788 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/Mangadex.kt @@ -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"