From 651acb7e1b5a0835659e62aa673b0e8fe3057e49 Mon Sep 17 00:00:00 2001 From: seew3l <90949336+seew3l@users.noreply.github.com> Date: Tue, 7 Feb 2023 07:49:34 -0500 Subject: [PATCH] Fix chapter name and number (#15259) --- src/es/tumangaonline/build.gradle | 2 +- .../extension/es/tumangaonline/TuMangaOnline.kt | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/es/tumangaonline/build.gradle b/src/es/tumangaonline/build.gradle index 583f04c86..337b07cbf 100644 --- a/src/es/tumangaonline/build.gradle +++ b/src/es/tumangaonline/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'TuMangaOnline' pkgNameSuffix = 'es.tumangaonline' extClass = '.TuMangaOnline' - extVersionCode = 39 + extVersionCode = 40 isNsfw = true } diff --git a/src/es/tumangaonline/src/eu/kanade/tachiyomi/extension/es/tumangaonline/TuMangaOnline.kt b/src/es/tumangaonline/src/eu/kanade/tachiyomi/extension/es/tumangaonline/TuMangaOnline.kt index 3956c7915..7265765dd 100644 --- a/src/es/tumangaonline/src/eu/kanade/tachiyomi/extension/es/tumangaonline/TuMangaOnline.kt +++ b/src/es/tumangaonline/src/eu/kanade/tachiyomi/extension/es/tumangaonline/TuMangaOnline.kt @@ -183,17 +183,12 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() { // Regular list of chapters val chapters = mutableListOf() 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() + val chaptername = chapelement.select("div.col-10.text-truncate").text().replace(" ", " ").trim() val scanelement = chapelement.select("ul.chapter-list > li") if (getScanlatorPref()) { - scanelement.forEach { chapters.add(regularChapterFromElement(it, chaptername, chapternumber)) } + scanelement.forEach { chapters.add(regularChapterFromElement(it, chaptername)) } } else { - scanelement.first { chapters.add(regularChapterFromElement(it, chaptername, chapternumber)) } + scanelement.first { chapters.add(regularChapterFromElement(it, chaptername)) } } } return chapters @@ -209,10 +204,9 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() { ?: 0 } private fun regularChapterListSelector() = "div.chapters > ul.list-group li.p-0.list-group-item" - private fun regularChapterFromElement(element: Element, chName: String, number: Float) = SChapter.create().apply { + private fun regularChapterFromElement(element: Element, chName: String) = SChapter.create().apply { url = element.select("div.row > .text-right > a").attr("href") 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