diff --git a/multisrc/overrides/wpmangareader/manhwaindo/src/ManhwaIndo.kt b/multisrc/overrides/wpmangareader/manhwaindo/src/ManhwaIndo.kt index 693072cb0..17420cdb2 100644 --- a/multisrc/overrides/wpmangareader/manhwaindo/src/ManhwaIndo.kt +++ b/multisrc/overrides/wpmangareader/manhwaindo/src/ManhwaIndo.kt @@ -1,13 +1,46 @@ package eu.kanade.tachiyomi.extension.id.manhwaindo import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.source.model.SManga +import okhttp3.Headers +import org.jsoup.nodes.Document import java.text.SimpleDateFormat import java.util.Locale class ManhwaIndo : WPMangaReader( - "Manhwa Indo", "https://manhwaindo.id", "id", - dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("id")) + "Manhwa Indo", "https://manhwaindo.id", "id", "/series", + SimpleDateFormat("MMMM dd, yyyy", Locale("id")) ) { + override fun headersBuilder(): Headers.Builder = Headers.Builder() + .add("Referer", baseUrl) + + // manga details + override fun mangaDetailsParse(document: Document) = SManga.create().apply { + author = document.select(seriesAuthorSelector).firstOrNull()?.ownText() + artist = document.select(seriesArtistSelector).firstOrNull()?.ownText() + genre = document.select(seriesGenreSelector).joinToString { it.text() } + status = parseStatus(document.select(seriesStatusSelector).text()) + thumbnail_url = document.select(seriesThumbnailSelector).attr("abs:src") + description = document.select(seriesDescriptionSelector).joinToString("\n") { it.text() } + + // add series type(manga/manhwa/manhua/other) thinggy to genre + document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let { + if (it.isEmpty().not() && genre!!.contains(it, true).not()) { + genre += if (genre!!.isEmpty()) it else ", $it" + } + } + + // add alternative name to manga description + document.select(altNameSelector).firstOrNull()?.ownText()?.let { + if (it.isEmpty().not()) { + description += when { + description!!.isEmpty() -> altName + it + else -> "\n\n$altName" + it + } + } + } + } + override val hasProjectPage = true } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangareader/WPMangaReaderGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangareader/WPMangaReaderGenerator.kt index 7b2f29bac..8c447a111 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangareader/WPMangaReaderGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangareader/WPMangaReaderGenerator.kt @@ -35,7 +35,7 @@ class WPMangaReaderGenerator : ThemeSourceGenerator { SingleLang("Mangasusu", "https://mangasusu.co.in", "id", isNsfw = true, overrideVersionCode = 1), SingleLang("Mangás Chan", "https://mangaschan.com", "pt-BR", className = "MangasChan"), SingleLang("Manhua Raw", "https://manhuaraw.com", "en"), - SingleLang("ManhwaIndo", "https://manhwaindo.id", "id", isNsfw = true), + SingleLang("ManhwaIndo", "https://manhwaindo.id", "id", isNsfw = true, overrideVersionCode = 1), SingleLang("Martial Manga", "https://martialmanga.com", "es"), SingleLang("Miau Scan", "https://miauscan.com", "es"), SingleLang("Mode Scanlator", "https://modescanlator.com", "pt-BR", overrideVersionCode = 7),