Closed chrisbanes closed 1 year ago
Nice, thanks! 👍
Started with PR #28 and some further parameters, it might be useful to structure the config. I thought something like this
val tmdb = Tmdb3 {
tmdbApiKey = "key"
accountCredentials {
// accessToken, refreshToken
}
httpClientConfig {
install(HttpCache) {
// ...
}
}
}
If you want to add your custom OkHttp client, we add the field customHttpClient
.
This PR adds a
(HttpClientConfig<*>.() -> Unit)
constructor parameter to Tmdb3 and Tmdb4, allowing clients to customize the Ktor client as they wish.My primary use case is to enable persistent Http caching (https://ktor.io/docs/client-caching.html#persistent_cache), but there are lots of other use cases too.