From a3f8c0a2368b441c273c0387d73edc7dee6720e4 Mon Sep 17 00:00:00 2001 From: PhantomShift <83253309+PhantomShift@users.noreply.github.com> Date: Sun, 17 Dec 2023 10:49:12 -0500 Subject: [PATCH] Fix MangaDex nsfw check Additionally check for pornographic content rating when labeling a work as NSFW. --- .../org/koitharu/kotatsu/parsers/site/all/MangaDexParser.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaDexParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaDexParser.kt index 18a612c81..e1039ae4c 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaDexParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaDexParser.kt @@ -110,7 +110,10 @@ internal class MangaDexParser(context: MangaLoaderContext) : MangaParser(context url = id, publicUrl = "https://$domain/title/$id", rating = RATING_UNKNOWN, - isNsfw = attrs.getStringOrNull("contentRating") == "erotica", + isNsfw = when (attrs.getStringOrNull("contentRating")) { + "erotica", "pornographic" -> true + else -> false + }, coverUrl = cover?.plus(".256.jpg").orEmpty(), largeCoverUrl = cover, description = attrs.optJSONObject("description")?.selectByLocale(),