Fix wrong language in originalLanguage tag. (#9600)

This commit is contained in:
Alessandro Jean 2021-10-24 14:39:21 -03:00 committed by GitHub
parent b9b91cf35a
commit 31e563c9ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

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

View File

@ -183,8 +183,8 @@ class MangaDexHelper() {
val altTitle = it.asMdMap()
altTitle[lang] ?: altTitle["en"] != null
}?.asMdMap()?.values?.singleOrNull()
?: titleMap["ja"] // romaji titles are sometimes ja (and are not altTitles)
?: titleMap.values.firstOrNull() // use literally anything from title as a last resort
?: titleMap["ja"] // romaji titles are sometimes ja (and are not altTitles)
?: titleMap.values.firstOrNull() // use literally anything from title as a last resort
title = cleanString(dirtyTitle ?: "")
coverFileName?.let {
@ -213,10 +213,14 @@ class MangaDexHelper() {
"Content rating: " + tempContentRating.capitalize(Locale.US)
}
val dexLocale = Locale.forLanguageTag(lang)
val nonGenres = listOf(
(attr.publicationDemographic ?: "").capitalize(Locale.US),
contentRating,
Locale(attr.originalLanguage ?: "").displayLanguage
Locale(attr.originalLanguage ?: "")
.getDisplayLanguage(dexLocale)
.capitalize(dexLocale)
)
val authors = mangaDataDto.relationships.filter { relationshipDto ->