Add support for determining series type (#10985)
This commit is contained in:
parent
6c512e4caf
commit
581f64ace0
|
@ -96,14 +96,17 @@ open class Genkan(
|
|||
.let { if (it.startsWith("http")) it else baseUrl + it }
|
||||
}
|
||||
|
||||
override fun mangaDetailsParse(document: Document): SManga {
|
||||
return SManga.create().apply {
|
||||
title = document.select("div#content h5").first().text()
|
||||
description = document.select("div.col-lg-9").text().substringAfter("Description ").substringBefore(" Volume")
|
||||
thumbnail_url = styleToUrl(document.select("div.media a").first())
|
||||
}
|
||||
protected var countryOfOriginSelector = ".card.mt-2 .list-item:contains(Country of Origin) .no-wrap"
|
||||
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
|
||||
title = document.select("div#content h5").first().text()
|
||||
description = document.select("div.col-lg-9").text().substringAfter("Description ").substringBefore(" Volume")
|
||||
thumbnail_url = styleToUrl(document.select("div.media a").first())
|
||||
genre = listOfNotNull(
|
||||
document.selectFirst(countryOfOriginSelector)?.let { countryOfOriginToSeriesType(it.text())}
|
||||
).joinToString()
|
||||
}
|
||||
|
||||
|
||||
override fun chapterListSelector() = "div.col-lg-9 div.flex"
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter {
|
||||
|
@ -137,6 +140,13 @@ open class Genkan(
|
|||
}
|
||||
}
|
||||
|
||||
private fun countryOfOriginToSeriesType(country: String) = when (country) {
|
||||
"South Korea" -> "Manhwa"
|
||||
"Japan" -> "Manga"
|
||||
"China" -> "Manhua"
|
||||
else -> null
|
||||
}
|
||||
|
||||
// Subtract relative date (e.g. posted 3 days ago)
|
||||
private fun parseRelativeDate(date: String): Long? {
|
||||
val trimmedDate = date.substringBefore(" ago").removeSuffix("s").split(" ")
|
||||
|
|
|
@ -9,7 +9,7 @@ class GenkanGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val themeClass = "Genkan"
|
||||
|
||||
override val baseVersionCode: Int = 2
|
||||
override val baseVersionCode: Int = 3
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Hunlight Scans", "https://hunlight-scans.info", "en"),
|
||||
|
|
Loading…
Reference in New Issue