catch exceprion in playheads() and postPlayheads() & update agp

* fix a crash, if there is no internet connection while in playback (closes #60)
* agp 7.2.0 -> 7.2.1
This commit is contained in:
Jannik 2022-06-06 13:14:41 +02:00
parent 12bbc2ef5f
commit de1f19c2b7
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
2 changed files with 11 additions and 4 deletions

View File

@ -550,8 +550,11 @@ object Crunchyroll {
return try { return try {
requestGet(playheadsEndpoint, parameters) requestGet(playheadsEndpoint, parameters)
}catch (ex: SerializationException) { } catch (ex: SerializationException) {
Log.e(TAG, "SerializationException in upNextSeries().", ex) Log.e(TAG, "SerializationException in playheads().", ex)
emptyMap()
} catch (ex: Throwable) {
Log.e(TAG, "Exception in playheads().", ex.cause)
emptyMap() emptyMap()
} }
} }
@ -571,7 +574,11 @@ object Crunchyroll {
put("playhead", playhead) put("playhead", playhead)
} }
requestPost(playheadsEndpoint, parameters, json) try {
requestPost(playheadsEndpoint, parameters, json)
} catch (ex: Throwable) {
Log.e(TAG, "Exception in postPlayheads()", ex.cause)
}
} }
/** /**

View File

@ -8,7 +8,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.2.0' classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong