From 04505aecbd4d2ab2e774298c98e4f3415c12b667 Mon Sep 17 00:00:00 2001 From: Ejan <35057681+e-shl@users.noreply.github.com> Date: Mon, 22 Aug 2022 20:30:43 +0500 Subject: [PATCH] [RU]MultiChan chapter_number & author (#13123) * [RU]MultiChan chapter_number & author * clean * clean2 --- multisrc/overrides/multichan/henchan/src/HenChan.kt | 2 +- .../eu/kanade/tachiyomi/multisrc/multichan/ChanGenerator.kt | 2 +- .../java/eu/kanade/tachiyomi/multisrc/multichan/MultiChan.kt | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/multisrc/overrides/multichan/henchan/src/HenChan.kt b/multisrc/overrides/multichan/henchan/src/HenChan.kt index e2424b7e2..cd38456f4 100644 --- a/multisrc/overrides/multichan/henchan/src/HenChan.kt +++ b/multisrc/overrides/multichan/henchan/src/HenChan.kt @@ -190,7 +190,7 @@ class HenChan : MultiChan("HenChan", "https://y.hentaichan.live", "ru") { chapter.setUrlWithoutDomain(element.select("h2 a").attr("href")) val chapterName = element.select("h2 a").attr("title") chapter.name = chapterName - chapter.chapter_number = "(глава\\s|часть\\s)(\\d+)".toRegex(RegexOption.IGNORE_CASE).find(chapterName)?.groupValues?.get(2)?.toFloat() ?: -1F + chapter.chapter_number = "(глава\\s|часть\\s)([0-9]+\\.?[0-9]*)".toRegex(RegexOption.IGNORE_CASE).find(chapterName)?.groupValues?.get(2)?.toFloat() ?: -1F chapter.date_upload = Date().time // setting to current date because of a sorting in the "Recent updates" section return chapter } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/multichan/ChanGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/multichan/ChanGenerator.kt index 238641f9c..fd6872878 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/multichan/ChanGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/multichan/ChanGenerator.kt @@ -9,7 +9,7 @@ class ChanGenerator : ThemeSourceGenerator { override val themeClass = "MultiChan" - override val baseVersionCode: Int = 1 + override val baseVersionCode: Int = 2 override val sources = listOf( SingleLang("MangaChan", "https://manga-chan.me", "ru", overrideVersionCode = 14), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/multichan/MultiChan.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/multichan/MultiChan.kt index b3f544349..c36f25b4c 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/multichan/MultiChan.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/multichan/MultiChan.kt @@ -95,7 +95,7 @@ abstract class MultiChan( val rawCategory = infoElement.select(":contains(Тип) a").text().lowercase() val manga = SManga.create() manga.title = document.select("title").text().substringBefore(" »") - manga.author = infoElement.select(":contains(Автор)").text() + manga.author = infoElement.select(":contains(Автор) .item2").text() manga.genre = rawCategory + ", " + document.select(".sidetags ul a:last-child").joinToString { it.text() } manga.status = parseStatus(infoElement.select(":contains(Загружено)").text()) manga.description = descElement.textNodes().first().text().trim() @@ -117,6 +117,7 @@ abstract class MultiChan( val chapter = SChapter.create() chapter.setUrlWithoutDomain(urlElement.attr("href")) chapter.name = urlElement.text() + chapter.chapter_number = "(глава\\s|часть\\s)([0-9]+\\.?[0-9]*)".toRegex(RegexOption.IGNORE_CASE).find(chapter.name)?.groupValues?.get(2)?.toFloat() ?: -1F chapter.date_upload = simpleDateFormat.parse(element.select("div.date").first().text())?.time ?: 0L return chapter }