[Mangadex] Fix uploader username handling (#12096)

This commit is contained in:
FlaminSarge 2022-06-06 09:25:31 -07:00 committed by GitHub
parent 9ebac7a263
commit d74e4708d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'MangaDex'
pkgNameSuffix = 'all.mangadex'
extClass = '.MangaDexFactory'
extVersionCode = 160
extVersionCode = 161
isNsfw = true
}

View File

@ -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

View File

@ -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>): String = when (availableLang) {
BRAZILIAN_PORTUGUESE, PORTUGUESE -> "Enviado por ${users.joinToString(" & ")}"
else -> "Uploaded by ${users.joinToString(" & ")}"
}
val noGroup: String = when (availableLang) {