Implement watch providers for TVShow

This commit is contained in:
Björn Orri Saemundsson 2021-01-06 10:23:22 +00:00
parent 03bcbda610
commit 7e183f7e3d
3 changed files with 10 additions and 0 deletions

View File

@ -309,6 +309,11 @@ namespace TMDbLib.Client
return await GetTvShowMethod<ResultContainer<Video>>(id, TvShowMethods.Videos, cancellationToken: cancellationToken).ConfigureAwait(false);
}
public async Task<SingleResultContainer<WatchProvidersByRegion>> GetTvShowWatchProvidersAsync(int id, CancellationToken cancellationToken = default(CancellationToken))
{
return await GetTvShowMethod<SingleResultContainer<WatchProvidersByRegion>>(id, TvShowMethods.WatchProviders, cancellationToken: cancellationToken).ConfigureAwait(false);
}
public async Task<bool> TvShowRemoveRatingAsync(int tvShowId, CancellationToken cancellationToken = default(CancellationToken))
{
RequireSessionId(SessionType.GuestSession);

View File

@ -140,6 +140,9 @@ namespace TMDbLib.Objects.TvShows
[JsonProperty("videos")]
public ResultContainer<Video> Videos { get; set; }
[JsonProperty("watch/providers")]
public SingleResultContainer<WatchProvidersByRegion> WatchProviders { get; set; }
[JsonProperty("vote_average")]
public double VoteAverage { get; set; }

View File

@ -34,5 +34,7 @@ namespace TMDbLib.Objects.TvShows
Recommendations = 1 << 11,
[EnumValue("reviews")]
Reviews = 1 << 12,
[EnumValue("watch/providers")]
WatchProviders = 1 << 13
}
}