Update factory code: add series type to genre (#6363)

add series type(manga/manhwa/manhua/other) thinggy to genre
This commit is contained in:
Riztard Lanthorn 2021-03-31 21:04:33 +07:00 committed by GitHub
parent 1569ea29d0
commit ad7d8f01d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -86,6 +86,11 @@ abstract class WPMangaReader(
thumbnail_url = document.select(".infomanga > div[itemprop=image] img, .thumb img").attr("src") thumbnail_url = document.select(".infomanga > div[itemprop=image] img, .thumb img").attr("src")
description = document.select(".desc, .entry-content[itemprop=description]").joinToString("\n") { it.text() } description = document.select(".desc, .entry-content[itemprop=description]").joinToString("\n") { it.text() }
// add series type(manga/manhwa/manhua/other) thinggy to genre
val type = document.select("span:contains(Type) a, .imptdt:contains(Type) a, a[href*=type\\=], .infotable tr:contains(Type) td:last-child").firstOrNull()?.ownText()
genre += if (genre!!.contains(type.toString())) "" else if (!type.isNullOrEmpty() && !genre.isNullOrEmpty()) ", $type"
else if (!type.isNullOrEmpty() && genre.isNullOrEmpty()) "$type" else ""
} }
private fun parseStatus(status: String) = when { private fun parseStatus(status: String) = when {

View File

@ -9,7 +9,7 @@ class WPMangaReaderGenerator : ThemeSourceGenerator {
override val themeClass = "WPMangaReader" override val themeClass = "WPMangaReader"
override val baseVersionCode: Int = 2 override val baseVersionCode: Int = 3
override val sources = listOf( override val sources = listOf(
SingleLang("Hikari Scan", "https://hikariscan.com.br", "pt-BR", overrideVersionCode = 1), SingleLang("Hikari Scan", "https://hikariscan.com.br", "pt-BR", overrideVersionCode = 1),