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
5 changed files with 21 additions and 1 deletions

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