RD.TMDB.Client
0.1.2
dotnet add package RD.TMDB.Client --version 0.1.2
NuGet\Install-Package RD.TMDB.Client -Version 0.1.2
<PackageReference Include="RD.TMDB.Client" Version="0.1.2" />
paket add RD.TMDB.Client --version 0.1.2
#r "nuget: RD.TMDB.Client, 0.1.2"
// Install RD.TMDB.Client as a Cake Addin #addin nuget:?package=RD.TMDB.Client&version=0.1.2 // Install RD.TMDB.Client as a Cake Tool #tool nuget:?package=RD.TMDB.Client&version=0.1.2
RD.TMDB.Client - Wrapper for the TMDB Api
A complete wrapper for v3 and v4 of the TMDB's API (TheMovieDb - https://www.themoviedb.org/)
Table of Contents
Examples
Get details about a movie:
ITmdbClient client = new TmdbClient("Token");
MovieDetail movie = await client.GetMovieDetailsAsync(693134);
Search for movies:
ITmdbClient client = new TmdbClient("Token");
ResultContainer<Movie> movies = await client.DiscoverMoviesAsync(new DiscoverMovieRequest()
{
Language = Iso639_1.English,
Year = 2024
});
Get additional informations about a movie in a single request:
ITmdbClient client = new TmdbClient("Token");
MovieDetail movie = await client.GetMovieDetailsAsync(693134,
MovieInformation.Videos | MovieInformation.Images);
foreach (Video video in movie.Videos.Results)
{}
foreach (ImageBase image in movie.Images.Posters)
{}
V4
[!NOTE]
To use the V4 Api, you need to use theTmdbV4Client
.
Add media items to a list:
ITmdbV4Client client = new TmdbV4Client("Token");
ItemsResponse response = await client.AddItemsToListAsync(139699, new ItemsRequest<ItemRequest>()
{
Media = new List<ItemRequest>()
{
new ItemRequest("movie", 550),
new ItemRequest("movie", 244786),
new ItemRequest("tv", 1396)
}
});
Dependencies
- Refit (Interfaces to define the api endpoints)
- RD.Extensions.Enum (Decorate enum values with additional data)
Informations
- All methods provide a
CancellationToken
to cancel the request. TmdbClient
contains all methods for the v3 api.TmdbClient
provide public properties to set default values for the Language and Country (Default is set to English and United States).- Methods and Requests support enum values for easy usage like
Iso639_1
for the language andIso3166_1
for countries. - Most static values like languages, countries, genres, etc. are provided as enums.
License
RD.TMDB.Client is licensed under the MIT License. See the LICENSE file for more informations.
ToDos
- Add Unit Tests
- Add examples
- Add method documentations
Work with api categories
The TMDB api is divided into different categories. Each category is represented by an interface. The TmdbClient
and TmdbV4Client
classes implement all interfaces.
The categories are as example Account, Authentication, Movies, TvShows, etc.
Append to the category name the word Provider
to get the interface name.
To get the interfaces, you can define it like this:
ITmdbClient client = new TmdbClient("Token");
IMovieProvider movieProvider = client;
//or
IMovieProvider movieProvider = new TmdbClient("Token");
MovieDetail movie = await movieProvider.GetMovieDetailsAsync(693134);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- RD.Extensions.Enum (>= 1.0.4)
- Refit (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.