From dc592e92b5eb260649c551fe5150dd2568a82d41 Mon Sep 17 00:00:00 2001 From: psychowood Date: Tue, 22 Nov 2016 22:39:27 +0100 Subject: [PATCH] Added Volume and Title to chapters from MangaHere (#523) --- .../data/source/online/english/Mangahere.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Mangahere.kt b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Mangahere.kt index ec7a11a0f3..862915e6ea 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Mangahere.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Mangahere.kt @@ -80,10 +80,22 @@ class Mangahere(override val id: Int) : ParsedOnlineSource() { override fun chapterListSelector() = ".detail_list > ul:not([class]) > li" override fun chapterFromElement(element: Element, chapter: Chapter) { - val urlElement = element.select("a").first() + val parentEl = element.select("span.left").first() + + val urlElement = parentEl.select("a").first() + + var volume = parentEl.select("span.mr6")?.first()?.text()?.trim()?:"" + if (volume.length > 0) { + volume = " - " + volume + } + + var title = parentEl?.textNodes()?.last()?.text()?.trim()?:"" + if (title.length > 0) { + title = " - " + title + } chapter.setUrlWithoutDomain(urlElement.attr("href")) - chapter.name = urlElement.text() + chapter.name = urlElement.text() + volume + title chapter.date_upload = element.select("span.right").first()?.text()?.let { parseChapterDate(it) } ?: 0 }