fix(pt/animestc): Fix IllegalStateException (close #2859) (#2870)

Co-authored-by: Claudemirovsky <63046606+Claudemirovsky@users.noreply.github.com>
This commit is contained in:
Edgard Lorraine Messias 2024-02-05 19:25:02 -03:00 committed by GitHub
parent e8a7678037
commit f58dc8237c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data <data
android:host="wwww.animestc.net" android:host="www.animestc.net"
android:pathPattern="/animes/..*" android:pathPattern="/animes/..*"
android:scheme="https" /> android:scheme="https" />
</intent-filter> </intent-filter>

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'AnimesTC' extName = 'AnimesTC'
extClass = '.AnimesTC' extClass = '.AnimesTC'
extVersionCode = 4 extVersionCode = 5
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -251,12 +251,12 @@ class AnimesTC : ConfigurableAnimeSource, AnimeHttpSource() {
// ============================= Utilities ============================== // ============================= Utilities ==============================
private fun Response.getAnimeDto(): AnimeDto { private fun Response.getAnimeDto(): AnimeDto {
val responseBody = use { it.body.string() } val jsonString = body.string()
return try { return try {
parseAs<AnimeDto> { responseBody } jsonString.parseAs<AnimeDto>()
} catch (e: Exception) { } catch (e: Exception) {
// URL intent handler moment // URL intent handler moment
parseAs<ResponseDto<AnimeDto>> { responseBody }.items.first() jsonString.parseAs<ResponseDto<AnimeDto>>().items.first()
} }
} }