From 708d7908aa910a9bc58f18b9a54bb68eff65fb1c Mon Sep 17 00:00:00 2001 From: Draken <131387159+dragonx943@users.noreply.github.com> Date: Sun, 9 Feb 2025 19:30:44 +0700 Subject: [PATCH] [GocTruyenTranh] Fixes Add NSFW detector by Tags [site/vi/GocTruyenTranh] --- .../org/koitharu/kotatsu/parsers/site/vi/GocTruyenTranh.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/vi/GocTruyenTranh.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/vi/GocTruyenTranh.kt index b08ebad3..fa16abb2 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/vi/GocTruyenTranh.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/vi/GocTruyenTranh.kt @@ -138,6 +138,11 @@ internal class GocTruyenTranh(context: MangaLoaderContext) : } else { emptySet() } + + // Check NSFW manga by tags, API / Site not have this information + val checkNsfw = tags.any { tag -> + tag.key in setOf("25", "39", "41", "43", "57", "63") + } Manga( id = generateUid(mangaUrl), @@ -147,7 +152,7 @@ internal class GocTruyenTranh(context: MangaLoaderContext) : altTitle = item.optString("origin_name")?.takeUnless { it == "null" || it.isEmpty() }, description = item.optString("content"), rating = RATING_UNKNOWN, - isNsfw = isNsfwSource, + isNsfw = checkNsfw || isNsfwSource, coverUrl = item.optString("thumbnail"), tags = tags, state = when (item.optString("status")) {