From 163cb85833efe3be1ee8dd93c9156b372e38f751 Mon Sep 17 00:00:00 2001 From: Chopper <156493704+choppeh@users.noreply.github.com> Date: Thu, 6 Jun 2024 03:33:30 -0300 Subject: [PATCH] LoadingArtist: Fix json parser (#3426) Fix json parser --- src/en/loadingartist/build.gradle | 2 +- .../tachiyomi/extension/en/loadingartist/LoadingArtist.kt | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/en/loadingartist/build.gradle b/src/en/loadingartist/build.gradle index c56e9dceb..e192b24ea 100644 --- a/src/en/loadingartist/build.gradle +++ b/src/en/loadingartist/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Loading Artist' extClass = '.LoadingArtist' - extVersionCode = 2 + extVersionCode = 3 } apply from: "$rootDir/common.gradle" diff --git a/src/en/loadingartist/src/eu/kanade/tachiyomi/extension/en/loadingartist/LoadingArtist.kt b/src/en/loadingartist/src/eu/kanade/tachiyomi/extension/en/loadingartist/LoadingArtist.kt index f439900d7..abb5cb410 100644 --- a/src/en/loadingartist/src/eu/kanade/tachiyomi/extension/en/loadingartist/LoadingArtist.kt +++ b/src/en/loadingartist/src/eu/kanade/tachiyomi/extension/en/loadingartist/LoadingArtist.kt @@ -10,9 +10,8 @@ import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.util.asJsoup import kotlinx.serialization.Serializable +import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json -import kotlinx.serialization.json.decodeFromJsonElement -import kotlinx.serialization.json.jsonObject import okhttp3.Request import okhttp3.Response import rx.Observable @@ -89,9 +88,7 @@ class LoadingArtist : HttpSource() { } override fun chapterListParse(response: Response): List { - val comics = json.parseToJsonElement(response.body.string()).jsonObject.map { - json.decodeFromJsonElement(it.value) - } + val comics = json.decodeFromString>(response.body.string()) val validTypes = listOf("comic", "game", "art") return comics.filter { validTypes.any { type -> it.section == type } }.map { SChapter.create().apply {