From bc8b461ab7c6e7eb98c8b3c3ada1e70688426f9c Mon Sep 17 00:00:00 2001 From: loocool2 <36128021+loocool2@users.noreply.github.com> Date: Sat, 11 Sep 2021 12:03:54 -0700 Subject: [PATCH] Fixed erotica and porn not showing in latest (#9039) --- src/all/mangadex/build.gradle | 2 +- .../tachiyomi/extension/all/mangadex/MangaDex.kt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index d885267f6..d2e1602d5 100644 --- a/src/all/mangadex/build.gradle +++ b/src/all/mangadex/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'MangaDex' pkgNameSuffix = 'all.mangadex' extClass = '.MangaDexFactory' - extVersionCode = 133 + extVersionCode = 134 containsNsfw = true } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDex.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDex.kt index 1f10b3f1e..ff3137d12 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDex.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDex.kt @@ -207,6 +207,18 @@ abstract class MangaDex(override val lang: String, val dexLang: String) : if (preferences.getBoolean(MDConstants.getOriginalLanguageKoreanPref(dexLang), false)) { addQueryParameter("originalLanguage[]", "ko") } + if (preferences.getBoolean(MDConstants.getContentRatingSafePrefKey(dexLang), true)) { + addQueryParameter("contentRating[]", "safe") + } + if (preferences.getBoolean(MDConstants.getContentRatingSuggestivePrefKey(dexLang), true)) { + addQueryParameter("contentRating[]", "suggestive") + } + if (preferences.getBoolean(MDConstants.getContentRatingEroticaPrefKey(dexLang), false)) { + addQueryParameter("contentRating[]", "erotica") + } + if (preferences.getBoolean(MDConstants.getContentRatingPornographicPrefKey(dexLang), false)) { + addQueryParameter("contentRating[]", "pornographic") + } }.build().toString() return GET(url, headers, CacheControl.FORCE_NETWORK) }