From 27a785e15e4a427ee8cd52b47ec1b91403d27257 Mon Sep 17 00:00:00 2001 From: az4521 <18432684+az4521@users.noreply.github.com> Date: Fri, 10 Sep 2021 12:21:36 -0400 Subject: [PATCH] fix megatokyo image selector & chapter order (#9024) * fix megatokyo image selector * Update build.gradle * also fix the reversed chapter order * whoops --- src/en/megatokyo/build.gradle | 2 +- .../kanade/tachiyomi/extension/en/megatokyo/Megatokyo.kt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/en/megatokyo/build.gradle b/src/en/megatokyo/build.gradle index 45b814a9a..99f103be3 100644 --- a/src/en/megatokyo/build.gradle +++ b/src/en/megatokyo/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Megatokyo' pkgNameSuffix = 'en.megatokyo' extClass = '.Megatokyo' - extVersionCode = 1 + extVersionCode = 2 } apply from: "$rootDir/common.gradle" diff --git a/src/en/megatokyo/src/eu/kanade/tachiyomi/extension/en/megatokyo/Megatokyo.kt b/src/en/megatokyo/src/eu/kanade/tachiyomi/extension/en/megatokyo/Megatokyo.kt index 6d816b0ce..5ae613480 100644 --- a/src/en/megatokyo/src/eu/kanade/tachiyomi/extension/en/megatokyo/Megatokyo.kt +++ b/src/en/megatokyo/src/eu/kanade/tachiyomi/extension/en/megatokyo/Megatokyo.kt @@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.ParsedHttpSource import okhttp3.OkHttpClient import okhttp3.Request +import okhttp3.Response import org.jsoup.nodes.Document import org.jsoup.nodes.Element import rx.Observable @@ -49,6 +50,10 @@ class Megatokyo : ParsedHttpSource() { override fun fetchMangaDetails(manga: SManga): Observable = fetchPopularManga(1) .map { it.mangas.first().apply { initialized = true } } + override fun chapterListParse(response: Response): List { + return super.chapterListParse(response).reversed() + } + override fun chapterListSelector() = "div.content h2:contains(Comics by Date) + div ul li a[name]" @@ -62,7 +67,7 @@ class Megatokyo : ParsedHttpSource() { } override fun pageListParse(document: Document) = - document.select("#strip-bl a img") + document.select("#strip img") .mapIndexed { i, element -> Page(i, "", "https://megatokyo.com/" + element.attr("src")) }