Webtoons: Fix cover and french status (#18157)
* Webtoons: Fix cover * Webtoons: french status and author name
This commit is contained in:
parent
5e4fe0ef68
commit
30ca9fbfbc
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.extension.all.webtoons
|
||||
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
import eu.kanade.tachiyomi.source.SourceFactory
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.GregorianCalendar
|
||||
import java.util.Locale
|
||||
@ -49,7 +50,15 @@ class WebtoonsES : WebtoonsSrc("Webtoons.com", "https://www.webtoons.com", "es")
|
||||
return GregorianCalendar(year.toInt(), monthIndex, day.toInt()).time.time
|
||||
}
|
||||
}
|
||||
class WebtoonsFR : WebtoonsSrc("Webtoons.com", "https://www.webtoons.com", "fr", dateFormat = SimpleDateFormat("d MMM yyyy", Locale.FRENCH))
|
||||
|
||||
class WebtoonsFR : WebtoonsSrc("Webtoons.com", "https://www.webtoons.com", "fr", dateFormat = SimpleDateFormat("d MMM yyyy", Locale.FRENCH)) {
|
||||
override fun String.toStatus(): Int = when {
|
||||
contains("NOUVEAU") -> SManga.ONGOING
|
||||
contains("TERMINÉ") -> SManga.COMPLETED
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
}
|
||||
|
||||
class WebtoonsZH : WebtoonsSrc("Webtoons.com", "https://www.webtoons.com", "zh-Hant", "zh-hant", "zh_TW", SimpleDateFormat("yyyy/MM/dd", Locale.TRADITIONAL_CHINESE)) {
|
||||
// Due to lang code getting more specific
|
||||
override val id: Long = 2959982438613576472
|
||||
|
@ -196,7 +196,8 @@ open class Webtoons(
|
||||
open fun parseDetailsThumbnail(document: Document): String? {
|
||||
val picElement = document.select("#content > div.cont_box > div.detail_body")
|
||||
val discoverPic = document.select("#content > div.cont_box > div.detail_header > span.thmb")
|
||||
return discoverPic.select("img").not("[alt='Representative image']").first()?.attr("src") ?: picElement.attr("style").substringAfter("url(")?.substringBeforeLast(")")
|
||||
return picElement.attr("style").substringAfter("url(").substringBeforeLast(")")
|
||||
.ifBlank { discoverPic.select("img").not("[alt='Representative image']").first()?.attr("src") }
|
||||
}
|
||||
|
||||
override fun mangaDetailsParse(document: Document): SManga {
|
||||
@ -206,7 +207,9 @@ open class Webtoons(
|
||||
val manga = SManga.create()
|
||||
manga.title = document.selectFirst("h1.subj, h3.subj")!!.text()
|
||||
manga.author = detailElement.select(".author:nth-of-type(1)").first()?.ownText()
|
||||
manga.artist = detailElement.select(".author:nth-of-type(2)").first()?.ownText() ?: manga.author
|
||||
?: detailElement.select(".author_area").first()?.ownText()
|
||||
manga.artist = detailElement.select(".author:nth-of-type(2)").first()?.ownText()
|
||||
?: detailElement.select(".author_area").first()?.ownText() ?: manga.author
|
||||
manga.genre = detailElement.select(".genre").joinToString(", ") { it.text() }
|
||||
manga.description = infoElement.select("p.summary").text()
|
||||
manga.status = infoElement.select("p.day_info").firstOrNull()?.text().orEmpty().toStatus()
|
||||
@ -214,7 +217,7 @@ open class Webtoons(
|
||||
return manga
|
||||
}
|
||||
|
||||
private fun String.toStatus(): Int = when {
|
||||
open fun String.toStatus(): Int = when {
|
||||
contains("UP") -> SManga.ONGOING
|
||||
contains("COMPLETED") -> SManga.COMPLETED
|
||||
else -> SManga.UNKNOWN
|
||||
|
@ -13,7 +13,7 @@ class WebtoonsGenerator : ThemeSourceGenerator {
|
||||
override val baseVersionCode: Int = 2
|
||||
|
||||
override val sources = listOf(
|
||||
MultiLang("Webtoons.com", "https://www.webtoons.com", listOf("en", "fr", "es", "id", "th", "zh-Hant", "de"), className = "WebtoonsFactory", pkgName = "webtoons", overrideVersionCode = 38),
|
||||
MultiLang("Webtoons.com", "https://www.webtoons.com", listOf("en", "fr", "es", "id", "th", "zh-Hant", "de"), className = "WebtoonsFactory", pkgName = "webtoons", overrideVersionCode = 39),
|
||||
SingleLang("Dongman Manhua", "https://www.dongmanmanhua.cn", "zh"),
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user