From dfb9bfae9aee0b79b7f8184b24706563413a1363 Mon Sep 17 00:00:00 2001 From: Carlos Date: Sun, 14 Oct 2018 17:49:27 -0400 Subject: [PATCH] fix mrm (#555) --- src/all/myreadingmanga/build.gradle | 4 ++-- .../extension/all/myreadingmanga/MyReadingManga.kt | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/all/myreadingmanga/build.gradle b/src/all/myreadingmanga/build.gradle index afb878517..b43720e7d 100644 --- a/src/all/myreadingmanga/build.gradle +++ b/src/all/myreadingmanga/build.gradle @@ -5,8 +5,8 @@ ext { appName = 'Tachiyomi: MyReadingManga' pkgNameSuffix = 'all.myreadingmanga' extClass = '.MyReadingMangaFactory' - extVersionCode = 9 - extVersionSuffix = 8 + extVersionCode = 10 + extVersionSuffix = 9 libVersion = '1.2' } diff --git a/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt b/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt index d73089997..e4286036a 100644 --- a/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt +++ b/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt @@ -75,8 +75,8 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() { private fun getImage(element: Element): String { return when { - element.attr("data-src").endsWith(".jpg") -> element.attr("data-src") - element.attr("src").endsWith(".jpg") -> element.attr("src") + element.attr("data-src").endsWith(".jpg") || element.attr("data-src").endsWith(".png") -> element.attr("data-src") + element.attr("src").endsWith(".jpg") || element.attr("src").endsWith(".png") -> element.attr("src") else -> element.attr("data-lazy-src") } } @@ -143,7 +143,13 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() { override fun pageListParse(response: Response): List { val body = response.asJsoup() val pages = mutableListOf() - val elements = body.select("div.separator > img") + var elements = body.select("div.separator > img") + if(elements.size == 0){ + elements = body.select("div.entry-content img") + } + + (0 until elements.size).mapTo(pages) { Page(it, "", getImage(elements[it])) } + (0 until elements.size).mapTo(pages) { Page(it, "", getImage(elements[it])) }