From 8717ee0a607ea3c2bc5b937175fd44b0d193abb5 Mon Sep 17 00:00:00 2001 From: Vetle Ledaal Date: Fri, 1 Jul 2022 23:06:01 +0000 Subject: [PATCH] MadTheme: use alternative pagination selector (#12374) --- .../java/eu/kanade/tachiyomi/multisrc/madtheme/MadTheme.kt | 6 +++++- .../kanade/tachiyomi/multisrc/madtheme/MadThemeGenerator.kt | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadTheme.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadTheme.kt index 52cf5d243..d96d5f7e0 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadTheme.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadTheme.kt @@ -110,7 +110,11 @@ abstract class MadTheme( thumbnail_url = element.select("img").first()!!.attr("abs:data-src") } - override fun searchMangaNextPageSelector(): String? = ".paginator [rel=next]" + /* + * Only some sites use the next/previous buttons, so instead we check for the next link + * after the active one. We use the :not() selector to exclude the optional next button + */ + override fun searchMangaNextPageSelector(): String? = ".paginator > a.active + a:not([rel=next])" // Details override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply { diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadThemeGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadThemeGenerator.kt index 9319bf433..b00268dec 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadThemeGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadThemeGenerator.kt @@ -9,7 +9,7 @@ class MadThemeGenerator : ThemeSourceGenerator { override val themeClass = "MadTheme" - override val baseVersionCode: Int = 6 + override val baseVersionCode: Int = 7 override val sources = listOf( SingleLang("BeeHentai", "https://beehentai.com", "en", isNsfw = true),