From e54e732bac23cb5e539b07ea577170ca906e904f Mon Sep 17 00:00:00 2001 From: AbdullahM0hamed <25087116+AbdullahM0hamed@users.noreply.github.com> Date: Sat, 15 Aug 2020 21:35:38 +0100 Subject: [PATCH] Fix Epikmanga (#4127) * Fix Epikmanga * Add header selector * Use header selector * Update the illusory build.gradle that somehow keeps managing to evade me --- src/all/fmreader/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/all/fmreader/FMReader.kt | 6 ++++-- .../tachiyomi/extension/all/fmreader/FMReaderFactory.kt | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/all/fmreader/build.gradle b/src/all/fmreader/build.gradle index e1e1ca350..f95a7aada 100644 --- a/src/all/fmreader/build.gradle +++ b/src/all/fmreader/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'FMReader (multiple aggregators)' pkgNameSuffix = 'all.fmreader' extClass = '.FMReaderFactory' - extVersionCode = 20 + extVersionCode = 21 libVersion = '1.2' containsNsfw = true } diff --git a/src/all/fmreader/src/eu/kanade/tachiyomi/extension/all/fmreader/FMReader.kt b/src/all/fmreader/src/eu/kanade/tachiyomi/extension/all/fmreader/FMReader.kt index 9ee5b4f20..2cc367036 100644 --- a/src/all/fmreader/src/eu/kanade/tachiyomi/extension/all/fmreader/FMReader.kt +++ b/src/all/fmreader/src/eu/kanade/tachiyomi/extension/all/fmreader/FMReader.kt @@ -122,11 +122,13 @@ abstract class FMReader( override fun latestUpdatesSelector() = popularMangaSelector() - override fun searchMangaSelector() = popularMangaSelector() + override fun searchMangaSelector() = popularMangaSelector() + + open val headerSelector = "h3" override fun popularMangaFromElement(element: Element): SManga { return SManga.create().apply { - element.select("h3 a").let { + element.select("$headerSelector a").let { setUrlWithoutDomain(it.attr("abs:href")) title = it.text() } diff --git a/src/all/fmreader/src/eu/kanade/tachiyomi/extension/all/fmreader/FMReaderFactory.kt b/src/all/fmreader/src/eu/kanade/tachiyomi/extension/all/fmreader/FMReaderFactory.kt index d70eacd93..200d1a4ed 100644 --- a/src/all/fmreader/src/eu/kanade/tachiyomi/extension/all/fmreader/FMReaderFactory.kt +++ b/src/all/fmreader/src/eu/kanade/tachiyomi/extension/all/fmreader/FMReaderFactory.kt @@ -253,7 +253,10 @@ class SayTruyen : FMReader("Say Truyen", "https://saytruyen.com", "vi") { class EpikManga : FMReader("Epik Manga", "https://www.epikmanga.com", "tr") { override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/seri-listesi?sorting=views&sorting-type=DESC&Sayfa=$page", headers) override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/seri-listesi?sorting=lastUpdate&sorting-type=DESC&Sayfa=$page", headers) - override fun popularMangaNextPageSelector() = "ul.pagination li.active + li:not(.disabled)" + override fun popularMangaNextPageSelector() = "ul.pagination li.active + li:not(.disabled)" + + override val headerSelector = "h4" + // search wasn't working on source's website override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable { return client.newCall(searchMangaRequest(page, query, filters))