From a552234fd319b6e5bbf0925b25bd68c3e6d9f126 Mon Sep 17 00:00:00 2001 From: nicki <72807749+curche@users.noreply.github.com> Date: Wed, 15 Jun 2022 19:42:11 +0530 Subject: [PATCH] MangaDex: Add Sort by Rating (#12204) * Add Sort by Rating to MangaDex Browse * Increment mangadex.extVersionCode * Add Portuguese translations for "Rating" Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> --- src/all/mangadex/build.gradle | 2 +- .../tachiyomi/extension/all/mangadex/MangaDexFilters.kt | 3 ++- .../kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index aa40fadf8..4d6bf8754 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 = 164 + extVersionCode = 165 isNsfw = true } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexFilters.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexFilters.kt index 23725523a..76c55bf71 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexFilters.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexFilters.kt @@ -170,7 +170,8 @@ class MangaDexFilters { Sortable(intl.sortContentCreatedAt, "createdAt"), Sortable(intl.sortContentInfoUpdatedAt, "updatedAt"), Sortable(intl.sortRelevance, "relevance"), - Sortable(intl.sortYear, "year") + Sortable(intl.sortYear, "year"), + Sortable(intl.sortRating, "rating") ) class SortFilter(intl: MangaDexIntl, private val sortables: Array) : diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt index e9bf64621..d9263419c 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt @@ -620,6 +620,11 @@ class MangaDexIntl(val lang: String) { else -> "Year" } + val sortRating: String = when (availableLang) { + BRAZILIAN_PORTUGUESE, PORTUGUESE -> "Nota" + else -> "Rating" + } + val hasAvailableChapters: String = when (availableLang) { BRAZILIAN_PORTUGUESE, PORTUGUESE -> "Há capítulos disponíveis" else -> "Has available chapters"