mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
chore: Tags for SFW
This commit is contained in:
parent
baeba83c62
commit
e679430a3d
1 changed files with 15 additions and 12 deletions
|
@ -10,22 +10,25 @@ fun Manga.isLewd(): Boolean {
|
||||||
val sourceName = Injekt.get<SourceManager>().get(source)?.name
|
val sourceName = Injekt.get<SourceManager>().get(source)?.name
|
||||||
val tags = genre?.split(",")?.map { it.trim().lowercase(Locale.US) } ?: emptyList()
|
val tags = genre?.split(",")?.map { it.trim().lowercase(Locale.US) } ?: emptyList()
|
||||||
|
|
||||||
if (!tags.none { isNonHentai(it) }) return false
|
if (!tags.none { it.isNonHentai() }) return false
|
||||||
return (sourceName != null && sourceName.isFromHentaiSource()) || tags.any { isHentai(it) }
|
return (sourceName != null && sourceName.isFromHentaiSource()) || tags.any { it.isHentai() }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isNonHentai(tag: String) = tag.contains("non-h", true)
|
private fun String.isNonHentai() =
|
||||||
|
contains("non-h", true) ||
|
||||||
|
contains("non-erotic", true) ||
|
||||||
|
contains("sfw", true)
|
||||||
|
|
||||||
private fun String.isFromHentaiSource() =
|
private fun String.isFromHentaiSource() =
|
||||||
contains("hentai", true) ||
|
contains("hentai", true) ||
|
||||||
contains("adult", true)
|
contains("adult", true)
|
||||||
|
|
||||||
private fun isHentai(tag: String) =
|
private fun String.isHentai() =
|
||||||
tag.contains("hentai", true) ||
|
contains("hentai", true) ||
|
||||||
tag.contains("adult", true) ||
|
contains("adult", true) ||
|
||||||
tag.contains("smut", true) ||
|
contains("smut", true) ||
|
||||||
tag.contains("lewd", true) ||
|
contains("lewd", true) ||
|
||||||
tag.contains("nsfw", true) ||
|
contains("nsfw", true) ||
|
||||||
tag.contains("erotic", true) ||
|
contains("erotic", true) ||
|
||||||
tag.contains("pornographic", true) ||
|
contains("pornographic", true) ||
|
||||||
tag.contains("18+", true)
|
contains("18+", true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue