Introduce ktor http client with okhttp backend
This commit is contained in:
1 parent
2c5646b1c2
commit
773993c6f2
3 files changed
+15
No files matched your search
@@ -55,6 +55,8 @@ import com.hippo.yorozuya.IntIdGenerator
|
||||
import eu.kanade.tachiyomi.core.preference.AndroidPreferenceStore
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
|
||||
import eu.kanade.tachiyomi.util.lang.launchIO
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.engine.okhttp.OkHttp
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
@@ -312,6 +314,14 @@ class EhApplication : Application(), DefaultLifecycleObserver, ImageLoaderFactor
|
||||
builder.build()
|
||||
}
|
||||
|
||||
val ktorClient by lazy {
|
||||
HttpClient(OkHttp) {
|
||||
engine {
|
||||
preconfigured = okHttpClient
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
val galleryDetailCache by lazy {
|
||||
LruCache<Long, GalleryDetail>(25).also {
|
||||
|
||||
Reference in new issue
Block a user