[RU]MultiChan chapter_number & author (#13123)
* [RU]MultiChan chapter_number & author * clean * clean2
This commit is contained in:
parent
a365107570
commit
04505aecbd
|
@ -190,7 +190,7 @@ class HenChan : MultiChan("HenChan", "https://y.hentaichan.live", "ru") {
|
||||||
chapter.setUrlWithoutDomain(element.select("h2 a").attr("href"))
|
chapter.setUrlWithoutDomain(element.select("h2 a").attr("href"))
|
||||||
val chapterName = element.select("h2 a").attr("title")
|
val chapterName = element.select("h2 a").attr("title")
|
||||||
chapter.name = chapterName
|
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
|
chapter.date_upload = Date().time // setting to current date because of a sorting in the "Recent updates" section
|
||||||
return chapter
|
return chapter
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ class ChanGenerator : ThemeSourceGenerator {
|
||||||
|
|
||||||
override val themeClass = "MultiChan"
|
override val themeClass = "MultiChan"
|
||||||
|
|
||||||
override val baseVersionCode: Int = 1
|
override val baseVersionCode: Int = 2
|
||||||
|
|
||||||
override val sources = listOf(
|
override val sources = listOf(
|
||||||
SingleLang("MangaChan", "https://manga-chan.me", "ru", overrideVersionCode = 14),
|
SingleLang("MangaChan", "https://manga-chan.me", "ru", overrideVersionCode = 14),
|
||||||
|
|
|
@ -95,7 +95,7 @@ abstract class MultiChan(
|
||||||
val rawCategory = infoElement.select(":contains(Тип) a").text().lowercase()
|
val rawCategory = infoElement.select(":contains(Тип) a").text().lowercase()
|
||||||
val manga = SManga.create()
|
val manga = SManga.create()
|
||||||
manga.title = document.select("title").text().substringBefore(" »")
|
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.genre = rawCategory + ", " + document.select(".sidetags ul a:last-child").joinToString { it.text() }
|
||||||
manga.status = parseStatus(infoElement.select(":contains(Загружено)").text())
|
manga.status = parseStatus(infoElement.select(":contains(Загружено)").text())
|
||||||
manga.description = descElement.textNodes().first().text().trim()
|
manga.description = descElement.textNodes().first().text().trim()
|
||||||
|
@ -117,6 +117,7 @@ abstract class MultiChan(
|
||||||
val chapter = SChapter.create()
|
val chapter = SChapter.create()
|
||||||
chapter.setUrlWithoutDomain(urlElement.attr("href"))
|
chapter.setUrlWithoutDomain(urlElement.attr("href"))
|
||||||
chapter.name = urlElement.text()
|
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
|
chapter.date_upload = simpleDateFormat.parse(element.select("div.date").first().text())?.time ?: 0L
|
||||||
return chapter
|
return chapter
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue