mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 20:57:24 +01:00
Fixed extensions call running on main thread
(cherry picked from commit 2b85bb5fb816c531982a1878e55fd88814452a2c)
This commit is contained in:
parent
9e4c61c139
commit
0a6f607e22
@ -10,6 +10,8 @@ import eu.kanade.tachiyomi.extension.model.Extension
|
|||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||||
import eu.kanade.tachiyomi.network.await
|
import eu.kanade.tachiyomi.network.await
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
|
|
||||||
@ -22,7 +24,9 @@ internal class ExtensionGithubApi {
|
|||||||
suspend fun findExtensions(): List<Extension.Available> {
|
suspend fun findExtensions(): List<Extension.Available> {
|
||||||
val call = GET("$REPO_URL/index.json")
|
val call = GET("$REPO_URL/index.json")
|
||||||
|
|
||||||
return parseResponse(network.client.newCall(call).await())
|
return withContext(Dispatchers.IO) {
|
||||||
|
parseResponse(network.client.newCall(call).await())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parseResponse(response: Response): List<Extension.Available> {
|
private fun parseResponse(response: Response): List<Extension.Available> {
|
||||||
|
Loading…
Reference in New Issue
Block a user