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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RD.TMDB.Client" Version="0.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RD.TMDB.Client --version 0.1.2
#r "nuget: RD.TMDB.Client, 0.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 the TmdbV4Client.

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

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 and Iso3166_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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.2 73 4/25/2024
0.1.1 77 4/25/2024