Giter Site home page Giter Site logo

vkay94 / tmdb-kotlin Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 2.0 1.47 MB

TheMovieDatabase API wrapper for Kotlin

Home Page: https://vkay94.github.io/TMDb-Kotlin

License: Apache License 2.0

Kotlin 100.00%
android api coroutines json kotlin retrofit themoviedatabase tmdb wrapper

tmdb-kotlin's People

Contributors

nevercom avatar vkay94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tmdb-kotlin's Issues

Providing `OkHttpClient`

Hi,
This is more of a question. I'm trying to understand the process of providing a different instance of OkHttpClient without interfering with library's functionality.

As stated in documentation, it is possible to add certain modifications to TMDbInterceptor and then assign the new Interceptor to TMDb.tmdbInterceptor before calling init. However it seems that TMDb.tmdbInterceptor is immediately overwritten in defaultOkHttpClient() function:

private fun defaultOkHttpClient(): OkHttpClient {
tmdbInterceptor = TMDbInterceptor(apiKey, bearerToken)
return OkHttpClient.Builder().addInterceptor(tmdbInterceptor).build()
}

Furthermore, if we provide our own instance of OkHttpClient, no TMDbInterceptor is attached to it, unless we add it to OkHttpClient ourselves and also set the TMDb.tmdbInterceptor, as it seems that it only gets instantiated in defaultOkHttpClient() function, and several functionalities of the library depend on TMDb.tmdbInterceptor not being null.

I'm not sure about all these and it would be great if you could shed some light on this matter.

If I'm right though, it seems that if the defaultOkHttpClient() get called anyway, regardless of user providing OkHttpClient or not, could be the solution. Of course it needs to instantiate a new OkHttpClient if user has not provided one, and then modify it (add Interceptor) and also instantiate the TMDb.tmdbInterceptor.

`JsonDataException` on `aggregateCrew method

Method: TvService.aggregateCrew()
Response: UnknownError(error=com.squareup.moshi.JsonDataException: Expected END_OBJECT but was NAME at path $.crew[0].jobs[0].credit_id, code=null, headers=null)

It seems that this is related to parsing jobs object which is present only in /tv/{tv_id}/aggregate_credits endpoint, as it happens in every TV Show with crew array not being empty.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.