[RU]MultiChan chapter_number & author (#13123)

* [RU]MultiChan chapter_number & author

* clean

* clean2
This commit is contained in:
Ejan 2022-08-22 20:30:43 +05:00 committed by GitHub
parent a365107570
commit 04505aecbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -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
}

View File

@ -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),

View File

@ -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
}