Add a new source to MangaThemesia (#17946)
This commit is contained in:
parent
01b37a751b
commit
ee9cd11fd0
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
Binary file not shown.
After Width: | Height: | Size: 173 KiB |
|
@ -0,0 +1,45 @@
|
||||||
|
package eu.kanade.tachiyomi.extension.id.soulscans
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
||||||
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
|
import org.jsoup.nodes.Document
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
|
class SoulScans : MangaThemesia("Soul Scans", "https://soulscans.my.id", "id") {
|
||||||
|
|
||||||
|
override val hasProjectPage = true
|
||||||
|
|
||||||
|
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
|
||||||
|
document.selectFirst(seriesDetailsSelector)?.let { seriesDetails ->
|
||||||
|
title = seriesDetails.selectFirst(seriesTitleSelector)?.text().orEmpty()
|
||||||
|
artist = seriesDetails.selectFirst(seriesArtistSelector)?.ownText().removeEmptyPlaceholder()
|
||||||
|
author = seriesDetails.selectFirst(seriesAuthorSelector)?.ownText().removeEmptyPlaceholder()
|
||||||
|
description = seriesDetails.select(seriesDescriptionSelector).joinToString("\n") { it.text() }.trim()
|
||||||
|
// Add alternative name to manga description
|
||||||
|
val altName = seriesDetails.selectFirst(seriesAltNameSelector)?.ownText().takeIf { it.isNullOrBlank().not() }
|
||||||
|
altName?.let {
|
||||||
|
description = "$description\n\n$altNamePrefix$altName".trim()
|
||||||
|
}
|
||||||
|
val genres = seriesDetails.select(seriesGenreSelector).map { it.text() }.toMutableList()
|
||||||
|
// Add series type (manga/manhwa/manhua/other) to genre
|
||||||
|
seriesDetails.selectFirst(seriesTypeSelector)?.ownText().takeIf { it.isNullOrBlank().not() }?.let { genres.add(it) }
|
||||||
|
genre = genres.map { genre ->
|
||||||
|
genre.lowercase(Locale.forLanguageTag(lang)).replaceFirstChar { char ->
|
||||||
|
if (char.isLowerCase()) {
|
||||||
|
char.titlecase(Locale.forLanguageTag(lang))
|
||||||
|
} else {
|
||||||
|
char.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.joinToString { it.trim() }
|
||||||
|
|
||||||
|
status = seriesDetails.selectFirst(seriesStatusSelector)?.text().parseStatus()
|
||||||
|
seriesDetails.select(seriesThumbnailSelector).firstOrNull()?.let { thumbnail_url = it.imgAttr() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun String?.removeEmptyPlaceholder(): String? {
|
||||||
|
return if (this.isNullOrBlank() || this == "-" || this == "N/A") null else this
|
||||||
|
}
|
||||||
|
}
|
|
@ -119,6 +119,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
|
||||||
SingleLang("Silence Scan", "https://silencescan.com.br", "pt-BR", isNsfw = true, overrideVersionCode = 5),
|
SingleLang("Silence Scan", "https://silencescan.com.br", "pt-BR", isNsfw = true, overrideVersionCode = 5),
|
||||||
SingleLang("SkyMangas", "https://skymangas.com", "es"),
|
SingleLang("SkyMangas", "https://skymangas.com", "es"),
|
||||||
SingleLang("Snudae Scans", "https://snudaescans.com", "en", isNsfw = true, className = "BatotoScans", overrideVersionCode = 1),
|
SingleLang("Snudae Scans", "https://snudaescans.com", "en", isNsfw = true, className = "BatotoScans", overrideVersionCode = 1),
|
||||||
|
SingleLang("Soul Scans", "https://soulscans.my.id", "id"),
|
||||||
SingleLang("SSSScanlator", "https://sssscanlator.com", "pt-BR"),
|
SingleLang("SSSScanlator", "https://sssscanlator.com", "pt-BR"),
|
||||||
SingleLang("Starlight Scan", "https://starligthscan.com", "pt-BR", isNsfw = true),
|
SingleLang("Starlight Scan", "https://starligthscan.com", "pt-BR", isNsfw = true),
|
||||||
SingleLang("Summer Fansub", "https://smmr.in", "pt-BR", isNsfw = true),
|
SingleLang("Summer Fansub", "https://smmr.in", "pt-BR", isNsfw = true),
|
||||||
|
|
Loading…
Reference in New Issue