Co-authored-by: Claudemirovsky <63046606+Claudemirovsky@users.noreply.github.com>
This commit is contained in:
parent
e8a7678037
commit
f58dc8237c
@ -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>
|
||||
|
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'AnimesTC'
|
||||
extClass = '.AnimesTC'
|
||||
extVersionCode = 4
|
||||
extVersionCode = 5
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user