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

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

View File

@ -97,6 +97,11 @@ class KomikCast : WPMangaStream("Komik Cast", "https://komikcast.com", "id") {
artist = infoElement.select("span:contains(Author:)").firstOrNull()?.ownText()
description = infoElement.select("div.komik_info-description-sinopsis p").joinToString("\n") { it.text() }
thumbnail_url = infoElement.select("div.komik_info-content-thumbnail img").imgAttr()
// add manga/manhwa/manhua thinggy to genre
val type = document.select("span:contains(Type) a").firstOrNull()?.ownText()
genre += if (genre!!.contains(type.toString())) "" else if (!type.isNullOrEmpty() && !genre.isNullOrEmpty()) ", $type"
else if (!type.isNullOrEmpty() && genre.isNullOrEmpty()) "$type" else ""
}
}
}

View File

@ -39,6 +39,11 @@ class SilenceScan : WPMangaStream(
description = infoEl.select("h2:contains(Sinopse) + div p").joinToString("\n") { it.text() }
genre = infoEl.select("b:contains(Gêneros) + span a").joinToString { it.text() }
thumbnail_url = infoEl.select("div.thumb img").imgAttr()
// add manga/manhwa/manhua thinggy to genre
val type = document.select(".imptdt:contains(Tipo) a, a[href*=type\\=]").firstOrNull()?.ownText()
genre += if (genre!!.contains(type.toString())) "" else if (!type.isNullOrEmpty() && !genre.isNullOrEmpty()) ", $type"
else if (!type.isNullOrEmpty() && genre.isNullOrEmpty()) "$type" else ""
}
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {

View File

@ -28,6 +28,11 @@ class WestManga : WPMangaStream("West Manga", "https://westmanga.info", "id") {
author = infoElement.select(".infotable tr:contains(Author) td:last-child").firstOrNull()?.ownText()
description = infoElement.select(".entry-content-single[itemprop=\"description\"]").joinToString("\n") { it.text() }
thumbnail_url = infoElement.select("div.thumb img").imgAttr()
// add manga/manhwa/manhua thinggy to genre
val type = document.select(".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 ""
}
}
}

View File

@ -171,6 +171,11 @@ abstract class WPMangaStream(
artist = infoElement.select(".fmed b:contains(Artist)+span, .imptdt:contains(Artist) i").firstOrNull()?.ownText()
description = infoElement.select("div.desc p, div.entry-content p").joinToString("\n") { it.text() }
thumbnail_url = infoElement.select("div.thumb img").imgAttr()
// add manga/manhwa/manhua 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 ""
}
}
}

View File

@ -9,7 +9,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
override val themeClass = "WPMangaStream"
override val baseVersionCode: Int = 2
override val baseVersionCode: Int = 3
override val sources = listOf(
SingleLang("Reset Scans", "https://reset-scans.com", "en"),