Fix empty lists on MerakiScans. (#208)

* Update manga selectors.

* Fix manga details.

* Update version code.
This commit is contained in:
ddmgy 2018-02-19 09:08:07 -05:00 committed by Carlos
parent 2192ef7524
commit 8ab4ab5ad5
2 changed files with 11 additions and 7 deletions

View File

@ -5,9 +5,9 @@ ext {
appName = 'Tachiyomi: MerakiScans' appName = 'Tachiyomi: MerakiScans'
pkgNameSuffix = 'en.merakiscans' pkgNameSuffix = 'en.merakiscans'
extClass = '.MerakiScans' extClass = '.MerakiScans'
extVersionCode = 1 extVersionCode = 2
extVersionSuffix = 1 extVersionSuffix = 1
libVersion = '1.0' libVersion = '1.2'
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -32,7 +32,7 @@ class MerakiScans : ParsedHttpSource() {
} }
} }
override fun popularMangaSelector() = "div.mng_lst > div.nde > div.det > a" override fun popularMangaSelector() = "div.mng_lst > div.row > div.item > div.det > a"
override fun latestUpdatesSelector() = popularMangaSelector() override fun latestUpdatesSelector() = popularMangaSelector()
@ -49,7 +49,7 @@ class MerakiScans : ParsedHttpSource() {
override fun latestUpdatesFromElement(element: Element) = popularMangaFromElement(element) override fun latestUpdatesFromElement(element: Element) = popularMangaFromElement(element)
override fun popularMangaNextPageSelector() = "div.next > a.gbutton:contains(Next »)" override fun popularMangaNextPageSelector() = null
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
@ -70,13 +70,17 @@ class MerakiScans : ParsedHttpSource() {
override fun mangaDetailsParse(document: Document) = SManga.create().apply { override fun mangaDetailsParse(document: Document) = SManga.create().apply {
val infoElement = document.select("div.mng_det > div.mng_ifo") val infoElement = document.select("div.mng_det > div.mng_ifo")
infoElement.select("div.det > p").forEachIndexed { i, el -> infoElement.select("div > p").forEachIndexed { i, el ->
if (i == 0) { if (i == 0) {
description = el.text().trim() description = el.text().trim()
} }
when (el.select("b").text().trim()) { when (el.select("b").text().trim()) {
"Author" -> author = el.select("a").text()?.trim() "Author" -> author = el.select("a").map {
"Artist" -> artist = el.select("a").text()?.trim() it.text().trim()
}.joinToString(", ")
"Artist" -> artist = el.select("a").map {
it.text().trim()
}.joinToString(", ")
"Category" -> genre = el.select("a").map { "Category" -> genre = el.select("a").map {
it.text().trim() it.text().trim()
}.joinToString(", ") }.joinToString(", ")