use of com.battlelancer.seriesguide.traktapi.SgTraktInterceptor in project SeriesGuide by UweTrottmann.
the class HttpClientModule method provideOkHttpClient.
/**
* Returns this apps {@link OkHttpClient} with enabled response cache. Should be used with API
* calls.
*/
@Provides
@Singleton
OkHttpClient provideOkHttpClient(SgApp app, Cache cache) {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.connectTimeout(CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
builder.readTimeout(READ_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
builder.addInterceptor(new SgTmdbInterceptor());
builder.addNetworkInterceptor(new SgTheTvdbInterceptor(app));
builder.addNetworkInterceptor(new SgTraktInterceptor(app));
builder.authenticator(new AllApisAuthenticator(app));
builder.cache(cache);
return builder.build();
}
Aggregations