fix mangadex titles having "" (#8037)

This commit is contained in:
Carlos 2021-07-09 18:04:08 -04:00 committed by GitHub
parent b3aaf136c2
commit 1cc39ff6e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'MangaDex'
pkgNameSuffix = 'all.mangadex'
extClass = '.MangaDexFactory'
extVersionCode = 122
extVersionCode = 123
libVersion = '1.2'
containsNsfw = true
}

View File

@ -3,6 +3,8 @@ package eu.kanade.tachiyomi.extension.all.mangadex.dto
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.contentOrNull
import kotlinx.serialization.json.jsonPrimitive
@Serializable
data class MangaListDto(
@ -59,6 +61,6 @@ data class TagDto(
fun JsonElement.asMdMap(): Map<String, String> {
return runCatching {
(this as JsonObject).map { it.key to it.value.toString() }.toMap()
(this as JsonObject).map { it.key to (it.value.jsonPrimitive.contentOrNull ?: "") }.toMap()
}.getOrElse { emptyMap() }
}