moviebaseapp / tmdb-kotlin Goto Github PK
View Code? Open in Web Editor NEW๐ฌ Modern powerful TMDB API to fetch movies and TV shows for Kotlin Multiplatform.
Home Page: https://www.moviebase.app
License: Apache License 2.0
๐ฌ Modern powerful TMDB API to fetch movies and TV shows for Kotlin Multiplatform.
Home Page: https://www.moviebase.app
License: Apache License 2.0
It would be great to add the opportunity to get movie logos.
Thanks a lot.
https://image.tmdb.org/t/p/original/5TjlgYl3DTYRIOlpjqylAgcHVBF.png
Library Version: 1.2.0
Description:
I am trying to fetch alternative titles for movies or shows. I've looked at the code, but I couldn't find information on how to achieve this. Can someone provide guidance to retrieve alternative titles? While I can see on TMDB Documentation API of Alternative Titles ==> https://api.themoviedb.org/3/movie/550/alternative_titles?api_key=""
Hi,
Are you still planning to implement the TmdbGenresApi
and provide IDs for all the various Movies/TV genres? Would be really helpful.
Thanks
In the README.md file, it is stated that 'tmdbAuthCredentials' can be used directly in the project. However, this variable is defined as internal, which means it cannot be accessed directly. Instead, a method called 'userAuthentication' has been defined, and the content of 'tmdbAuthCredentials' needs to be changed through this method. You need to change just README.md file for misinformation.
I'm getting an exception with v0.6.3 when calling
Tmdb3.find.find("tt11271038", "en", TmdbExternalSource.IMDB)
Stacktrace:
kotlinx.serialization.MissingFieldException:
Field 'known_for_department' is required for type with serial name 'app.moviebase.tmdb.model.TmdbCrew', but it was missing
at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
at app.moviebase.tmdb.model.TmdbCrew.<init>(TmdbPeopleModel.kt:115)
at app.moviebase.tmdb.model.TmdbCrew$$serializer.deserialize(TmdbPeopleModel.kt:115)
at app.moviebase.tmdb.model.TmdbCrew$$serializer.deserialize(TmdbPeopleModel.kt:115)
Hi, I need some advice I don't know if I'm making a mistake somewhere but, whenever I try to get information about a movie, it throws me a mistake
Try for example Avengers: Endgame TMDb ID = 299534
It throws an error: app.moviebase.tmdb.model.TmdbVideoType does not contain element with name 'Bloopers'
my method is
` private suspend fun fetchMovie(movieId: Int): TmdbMovieDetail? {
return try {
tmdbApi.movies.getDetails(
movieId,
"en-US",
listOf(
AppendResponse.EXTERNAL_IDS,
AppendResponse.CREDITS,
AppendResponse.RELEASES_DATES,
AppendResponse.IMAGES,
AppendResponse.MOVIE_CREDITS,
AppendResponse.VIDEOS,
AppendResponse.CONTENT_RATING,
AppendResponse.WATCH_PROVIDERS
)
)
} catch (e: ResponseException) {
if (e.response.status == HttpStatusCode.NotFound) null else throw e
}
}
`
Process: com.octopus.mplay, PID: 25580
kotlinx.serialization.SerializationException: app.moviebase.tmdb.model.TmdbVideoType does not contain element with name 'Bloopers'
at kotlinx.serialization.json.internal.JsonNamesMapKt.getJsonNameIndexOrThrow(JsonNamesMap.kt:63)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeEnum(StreamingJsonDecoder.kt:265)
at app.moviebase.tmdb.model.TmdbVideoType$$serializer.deserialize(TmdbModel.kt:108)
at app.moviebase.tmdb.model.TmdbVideoType$$serializer.deserialize(TmdbModel.kt:108)
at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:36)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:79)
at app.moviebase.tmdb.model.TmdbVideo$$serializer.deserialize(TmdbModel.kt:141)
at app.moviebase.tmdb.model.TmdbVideo$$serializer.deserialize(TmdbModel.kt:141)
at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:36)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:535)
at kotlinx.serialization.internal.ListLikeSerializer.readElement(CollectionSerializers.kt:80)
at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51)
at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36)
at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:36)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
at app.moviebase.tmdb.model.TmdbResult$$serializer.deserialize(TmdbModel.kt:49)
at app.moviebase.tmdb.model.TmdbResult$$serializer.deserialize(TmdbModel.kt:49)
at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:36)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:79)
at app.moviebase.tmdb.model.TmdbMovieDetail$$serializer.deserialize(TmdbMovieModel.kt:61)
at app.moviebase.tmdb.model.TmdbMovieDetail$$serializer.deserialize(TmdbMovieModel.kt:61)
at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:36)
at kotlinx.serialization.json.Json.decodeFromString(Json.kt:100)
at io.ktor.serialization.kotlinx.KotlinxSerializationConverter.deserialize(KotlinxSerializationConverter.kt:55)
at io.ktor.client.plugins.contentnegotiation.ContentNegotiation$Plugin$install$2.invokeSuspend(ContentNegotiation.kt:135)
at io.ktor.client.plugins.contentnegotiation.ContentNegotiation$Plugin$install$2.invoke(Unknown Source:13)
2022-06-11 22:53:24.305 25580-25616/com.octopus.mplay E/AndroidRuntime: at io.ktor.client.plugins.contentnegotiation.ContentNegotiation$Plugin$install$2.invoke(Unknown Source:6)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:123)
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:81)
at io.ktor.client.HttpClient$4.invokeSuspend(HttpClient.kt:170)
at io.ktor.client.HttpClient$4.invoke(Unknown Source:11)
at io.ktor.client.HttpClient$4.invoke(Unknown Source:6)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:123)
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:81)
at io.ktor.util.pipeline.SuspendFunctionGun.proceedWith(SuspendFunctionGun.kt:91)
at io.ktor.client.plugins.HttpCallValidator$Companion$install$2.invokeSuspend(HttpCallValidator.kt:140)
at io.ktor.client.plugins.HttpCallValidator$Companion$install$2.invoke(Unknown Source:13)
at io.ktor.client.plugins.HttpCallValidator$Companion$install$2.invoke(Unknown Source:6)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:123)
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:81)
at io.ktor.util.pipeline.SuspendFunctionGun.execute$ktor_utils(SuspendFunctionGun.kt:101)
at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:77)
at io.ktor.client.call.HttpClientCall.body(HttpClientCall.kt:87)
at app.moviebase.tmdb.api.TmdbMoviesApi.getDetails(TmdbMoviesApi.kt:61)
at app.moviebase.tmdb.api.TmdbMoviesApi$getDetails$1.invokeSuspend(Unknown Source:16)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Add the model and add the endpoints for:
When calling:
Tmdb3.find.find("tt10919380", "en", TmdbExternalSource.IMDB)
I get an error:
app.moviebase.tmdb.model.TmdbGender does not contain element with name '3'
It would probably be fixed by adding the following to TmdbGender:
@SerialName("3")
NON_BINARY(3),
Thank you!
Ktor introduces defaultRequest, which we can use instead of custom extensions.
Fix the issue: Fields [name, original_name] are required for type with serial name 'collection', but they were missing
It would be handy to try out unreleased changes. Automatically publishing snapshots is a simple way to achieve this.
https://github.com/chrisbanes/snapper/blob/main/.github/workflows/build.yml#L101
All the TmdbReleaseDate
obtained by calling movies.getDetails
on a Tmdb3
, with AppendResponse.RELEASES_DATES
, contain a null
releaseDate
.
I suspect it's because of a bug in LocalDateTimeSerializer
: the class tries to parse the String as an instant, which it is, but then ignores the result, see this line.
An example of String being parsed to null
is 1993-07-08T00:00:00.000Z
: toInstant()
works, while toLocalDateTime()
errors out with:
java.time.format.DateTimeParseException: Text '1993-07-08T00:00:00.000Z' could not be parsed, unparsed text found at index 23
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.