mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-10 19:18:56 +01:00
More coroutine network call fixes
This commit is contained in:
@@ -6,6 +6,8 @@ import eu.kanade.tachiyomi.data.updater.UpdateResult
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import eu.kanade.tachiyomi.network.await
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import okhttp3.OkHttpClient
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
@@ -23,7 +25,9 @@ class DevRepoUpdateChecker : UpdateChecker() {
|
||||
}
|
||||
|
||||
override suspend fun checkForUpdate(): UpdateResult {
|
||||
val response = client.newCall(GET(DevRepoRelease.LATEST_URL)).await(assertSuccess = false)
|
||||
val response = withContext(Dispatchers.IO) {
|
||||
client.newCall(GET(DevRepoRelease.LATEST_URL)).await(assertSuccess = false)
|
||||
}
|
||||
|
||||
// Get latest repo version number from header in format "Location: tachiyomi-r1512.apk"
|
||||
val latestVersionNumber: String = versionRegex.find(response.header("Location")!!)!!.groupValues[1]
|
||||
|
||||
Reference in New Issue
Block a user