[Feature] TuMangaOnline - Choose Scans (#1673)

[Feature] TuMangaOnline - Choose Scans
This commit is contained in:
happywillow0 2019-10-18 16:51:28 -04:00 committed by arkon
parent 1d5df79964
commit bd92939583
2 changed files with 11 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: TuMangaOnline'
pkgNameSuffix = 'es.tumangaonline'
extClass = '.TuMangaOnline'
extVersionCode = 9
extVersionCode = 10
libVersion = '1.2'
}

View File

@ -191,7 +191,13 @@ class TuMangaOnline : ParsedHttpSource() {
}
// Regular list of chapters
return document.select(regularChapterListSelector()).map { regularChapterFromElement(it) }
val chapters = mutableListOf<SChapter>()
document.select(regularChapterListSelector()).forEach { chapelement ->
val chapternumber = chapelement.select("a.btn-collapse").text().substringBefore(":").substringAfter("Capítulo").trim().toFloat()
val chaptername = chapelement.select("div.col-10.text-truncate").text()
chapelement.select("ul.chapter-list > li").forEach { chapters.add(regularChapterFromElement(it, chaptername, chapternumber)) }
}
return chapters
}
override fun chapterListSelector() = throw UnsupportedOperationException("Not used")
@ -208,9 +214,10 @@ class TuMangaOnline : ParsedHttpSource() {
private fun regularChapterListSelector() = "div.chapters > ul.list-group li.p-0.list-group-item"
private fun regularChapterFromElement(element: Element) = SChapter.create().apply {
private fun regularChapterFromElement(element: Element, chname: String, number: Float) = SChapter.create().apply {
setUrlWithoutDomain(element.select("div.row > .text-right > a").attr("href"))
name = element.select("div.col-10.text-truncate").text()
name = chname
chapter_number = number
scanlator = element.select("div.col-md-6.text-truncate")?.text()
date_upload = element.select("span.badge.badge-primary.p-2").first()?.text()?.let { parseChapterDate(it) } ?: 0
}