From f58dc8237cc181771faa67a6e966011b8d43cccf Mon Sep 17 00:00:00 2001 From: Edgard Lorraine Messias Date: Mon, 5 Feb 2024 19:25:02 -0300 Subject: [PATCH] fix(pt/animestc): Fix IllegalStateException (close #2859) (#2870) Co-authored-by: Claudemirovsky <63046606+Claudemirovsky@users.noreply.github.com> --- src/pt/animestc/AndroidManifest.xml | 2 +- src/pt/animestc/build.gradle | 2 +- .../kanade/tachiyomi/animeextension/pt/animestc/AnimesTC.kt | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pt/animestc/AndroidManifest.xml b/src/pt/animestc/AndroidManifest.xml index 14e02257c5..e826c52050 100644 --- a/src/pt/animestc/AndroidManifest.xml +++ b/src/pt/animestc/AndroidManifest.xml @@ -14,7 +14,7 @@ diff --git a/src/pt/animestc/build.gradle b/src/pt/animestc/build.gradle index 4891df1c7d..074cd054a3 100644 --- a/src/pt/animestc/build.gradle +++ b/src/pt/animestc/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'AnimesTC' extClass = '.AnimesTC' - extVersionCode = 4 + extVersionCode = 5 } apply from: "$rootDir/common.gradle" diff --git a/src/pt/animestc/src/eu/kanade/tachiyomi/animeextension/pt/animestc/AnimesTC.kt b/src/pt/animestc/src/eu/kanade/tachiyomi/animeextension/pt/animestc/AnimesTC.kt index d94a8e5223..96a5c3836b 100644 --- a/src/pt/animestc/src/eu/kanade/tachiyomi/animeextension/pt/animestc/AnimesTC.kt +++ b/src/pt/animestc/src/eu/kanade/tachiyomi/animeextension/pt/animestc/AnimesTC.kt @@ -251,12 +251,12 @@ class AnimesTC : ConfigurableAnimeSource, AnimeHttpSource() { // ============================= Utilities ============================== private fun Response.getAnimeDto(): AnimeDto { - val responseBody = use { it.body.string() } + val jsonString = body.string() return try { - parseAs { responseBody } + jsonString.parseAs() } catch (e: Exception) { // URL intent handler moment - parseAs> { responseBody }.items.first() + jsonString.parseAs>().items.first() } }