Skip to content

Commit

Permalink
fix(pt/animestc): Fix IllegalStateException (close #2859) (#2870)
Browse files Browse the repository at this point in the history
Co-authored-by: Claudemirovsky <[email protected]>
  • Loading branch information
edgardmessias and Claudemirovsky authored Feb 5, 2024
1 parent e8a7678 commit f58dc82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pt/animestc/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="wwww.animestc.net"
android:host="www.animestc.net"
android:pathPattern="/animes/..*"
android:scheme="https" />
</intent-filter>
Expand Down
2 changes: 1 addition & 1 deletion src/pt/animestc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'AnimesTC'
extClass = '.AnimesTC'
extVersionCode = 4
extVersionCode = 5
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -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<AnimeDto> { responseBody }
jsonString.parseAs<AnimeDto>()
} catch (e: Exception) {
// URL intent handler moment
parseAs<ResponseDto<AnimeDto>> { responseBody }.items.first()
jsonString.parseAs<ResponseDto<AnimeDto>>().items.first()
}
}

Expand Down

0 comments on commit f58dc82

Please sign in to comment.