From ab3e45e171dd8896a63a5c499fbe9f98e8037e96 Mon Sep 17 00:00:00 2001 From: Edgard Lorraine Messias Date: Sat, 3 Feb 2024 14:34:15 -0300 Subject: [PATCH 1/3] fix(pt/animestc): Fix IllegalStateException (close #2859) --- src/pt/animestc/build.gradle | 2 +- .../kanade/tachiyomi/animeextension/pt/animestc/AnimesTC.kt | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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..3533f2c920 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,11 @@ class AnimesTC : ConfigurableAnimeSource, AnimeHttpSource() { // ============================= Utilities ============================== private fun Response.getAnimeDto(): AnimeDto { - val responseBody = use { it.body.string() } return try { - parseAs { responseBody } + parseAs { it } } catch (e: Exception) { // URL intent handler moment - parseAs> { responseBody }.items.first() + parseAs> { it }.items.first() } } From 44db7e0d1ab7564643b6e71b891d39f589580c1b Mon Sep 17 00:00:00 2001 From: Claudemirovsky <63046606+Claudemirovsky@users.noreply.github.com> Date: Sun, 4 Feb 2024 09:22:18 +0000 Subject: [PATCH 2/3] fix: Fix IllegalStateException with the URL intent handler --- .../kanade/tachiyomi/animeextension/pt/animestc/AnimesTC.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 3533f2c920..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,11 +251,12 @@ class AnimesTC : ConfigurableAnimeSource, AnimeHttpSource() { // ============================= Utilities ============================== private fun Response.getAnimeDto(): AnimeDto { + val jsonString = body.string() return try { - parseAs { it } + jsonString.parseAs() } catch (e: Exception) { // URL intent handler moment - parseAs> { it }.items.first() + jsonString.parseAs>().items.first() } } From b51cd24f39a3ff3a0fa9216329355db467d53046 Mon Sep 17 00:00:00 2001 From: Claudemirovsky <63046606+Claudemirovsky@users.noreply.github.com> Date: Sun, 4 Feb 2024 09:24:40 +0000 Subject: [PATCH 3/3] fix(androidmanifest): Fix host address --- src/pt/animestc/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@