Coder Social home page Coder Social logo

moviebaseapp / trakt-kotlin Goto Github PK

View Code? Open in Web Editor NEW
40.0 0.0 3.0 437 KB

πŸ“Ί Modern powerful Trakt API to track, discover and share your movies & TV shows.

Home Page: https://www.moviebase.app

License: Apache License 2.0

Kotlin 100.00%
android kotlin movies movies-api trakt tmdb kotlin-native kotlin-multiplatform ktor-client kotlin-js

trakt-kotlin's People

Contributors

chrisbanes avatar chriskruegerdev avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

chrisbanes

trakt-kotlin's Issues

Facelift the project

Adopt the same facelift as in the project MoviebaseApp/tmdb-api.

  • Reorganize tags & folders
  • Add Github Action
  • Integrate dependabot
  • Automatically snapshot publishing
  • Add Gradle catalog & update all libraries
  • Add spotless / klint
  • Update README

Complete Takt API

  • Refactor HttpClient building and lazy initialization
  • Add HttpClient configuration
  • Use defaultRequests
  • User Coroutines tests
  • Add missing endpoints (pending)

IllegalStateException: Fail to prepare request body for sending when posting TraktSyncItems

Looks like we need to hook up the polymorphic serializers for posting.

Error:

java.lang.IllegalStateException: Fail to prepare request body for sending. 
The body type is: class app.moviebase.trakt.model.TraktSyncItems (Kotlin reflection is not available), with Content-Type: null.
   
If you expect serialized body, please check that you have installed the corresponding plugin(like `ContentNegotiation`) and set `Content-Type` header.
    at io.ktor.client.plugins.HttpSend$Plugin$install$1.invokeSuspend(HttpSend.kt:88)
    at io.ktor.client.plugins.HttpSend$Plugin$install$1.invoke(Unknown Source:15)
    at io.ktor.client.plugins.HttpSend$Plugin$install$1.invoke(Unknown Source:4)
    at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
    at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
    at io.ktor.util.pipeline.SuspendFunctionGun.proceedWith(SuspendFunctionGun.kt:88)
    at io.ktor.client.plugins.HttpCallValidator$Companion$install$1.invokeSuspend(HttpCallValidator.kt:130)
    at io.ktor.client.plugins.HttpCallValidator$Companion$install$1.invoke(Unknown Source:13)
    at io.ktor.client.plugins.HttpCallValidator$Companion$install$1.invoke(Unknown Source:4)
    at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
    at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
    at io.ktor.client.plugins.HttpRequestLifecycle$Plugin$install$1.invokeSuspend(HttpRequestLifecycle.kt:38)
    at io.ktor.client.plugins.HttpRequestLifecycle$Plugin$install$1.invoke(Unknown Source:11)
    at io.ktor.client.plugins.HttpRequestLifecycle$Plugin$install$1.invoke(Unknown Source:4)
    at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:120)
    at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:78)
    at io.ktor.util.pipeline.SuspendFunctionGun.execute$ktor_utils(SuspendFunctionGun.kt:98)
    at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:77)
    at io.ktor.client.HttpClient.execute$ktor_client_core(HttpClient.kt:191)
    at io.ktor.client.statement.HttpStatement.executeUnsafe(HttpStatement.kt:108)
    at io.ktor.client.statement.HttpStatement.execute(HttpStatement.kt:47)
    at io.ktor.client.statement.HttpStatement.execute(HttpStatement.kt:62)
    at app.moviebase.trakt.api.TraktSyncApi.removeWatchedHistory(TraktSyncApi.kt:94)

Not handling HTTP 429 responses

I got the following exception logged in Crashlytics:

Exception: Uj: Client request(POST https://api.trakt.tv/sync/history) invalid: 429 . Text: "AUTHED_API_POST_LIMIT rate limit exceeded. Please wait 1 seconds then retry your request."
       at io.ktor.client.plugins.DefaultResponseValidationKt$addDefaultResponseValidation$1$1.invokeSuspend(DefaultResponseValidation.kt:54)
       at io.ktor.client.plugins.DefaultResponseValidationKt$addDefaultResponseValidation$1$1.invoke(DefaultResponseValidation.kt:13)
       at io.ktor.client.plugins.DefaultResponseValidationKt$addDefaultResponseValidation$1$1.invoke(DefaultResponseValidation.kt:13)
       at io.ktor.client.plugins.HttpCallValidator.validateResponse(HttpCallValidator.kt:51)
       at io.ktor.client.plugins.HttpCallValidator.access$validateResponse(HttpCallValidator.kt:43)
       at io.ktor.client.plugins.HttpCallValidator$Companion$install$3.invokeSuspend(HttpCallValidator.kt:152)

We should add retry backoff.

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.