From d74e4708d785b509d47714bb8c44c4da00ec08c7 Mon Sep 17 00:00:00 2001 From: FlaminSarge Date: Mon, 6 Jun 2022 09:25:31 -0700 Subject: [PATCH] [Mangadex] Fix uploader username handling (#12096) --- src/all/mangadex/build.gradle | 2 +- .../tachiyomi/extension/all/mangadex/MangaDexHelper.kt | 6 +----- .../kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt | 6 +++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index 48dabf0e6..6245cf03c 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 = 160 + extVersionCode = 161 isNsfw = true } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt index 883664af8..7e8bcd2f2 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt @@ -331,11 +331,7 @@ class MangaDexHelper(private val lang: String) { ) } .mapNotNull { it.attributes!!.username } - - users.joinToString( - " & ", - if (users.isNotEmpty()) intl.uploadedBy(users.toString()) else "" - ) + if (users.isNotEmpty()) intl.uploadedBy(users) else "" } .ifEmpty { intl.noGroup } // "No Group" as final resort 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 b1c5e6fa0..e9bf64621 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 @@ -636,9 +636,9 @@ class MangaDexIntl(val lang: String) { else -> "Unable to process Chapter request. HTTP code: $code" } - fun uploadedBy(user: String): String = when (availableLang) { - BRAZILIAN_PORTUGUESE, PORTUGUESE -> "Enviado por $user" - else -> "Uploaded by $user" + fun uploadedBy(users: List): String = when (availableLang) { + BRAZILIAN_PORTUGUESE, PORTUGUESE -> "Enviado por ${users.joinToString(" & ")}" + else -> "Uploaded by ${users.joinToString(" & ")}" } val noGroup: String = when (availableLang) {