Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.59 KB

README.md

File metadata and controls

51 lines (37 loc) · 1.59 KB

TrackSeries TheTVDBClient

.NET Client for TheTVDB API integrated with IHttpClientFactory and IServiceCollection.

Build NuGet

Installing via NuGet

dotnet add package TrackSeries.TheTVDB.Client
Install-Package TrackSeries.TheTVDB.Client

Getting Started

The best way of using the client is adding the dependencies to the ServiceCollection and resolving ITVDBClient where you'd like to use it:

services.AddTVDBClient(options => 
{
    options.ApiKey = "Set here your API-KEY for TheTVDB";
});

The client will automatically manage tokens for you so you don't need to worry about it. In case you would like to authenticate to run actions over an specific TheTVDB user you can use the following:

await client.Authentication.AuthenticateAsync("Username", "UserKey");

Now you will be able to use the endpoints under Users:

var userFavoriteSeries = await client.Users.GetFavoritesAsync();

It's possible to share the context between all the instances of the client (token and language):

services.AddTVDBClient(options => 
{
    options.ApiKey = "Set here your API-KEY for TheTVDB";
    options.ShareContextBetweenClients = true;
});

Acknowledgements

Big thanks to HristoKolev for his awesome work on TvDbSharper.