diff --git a/TMDbLib/Client/TMDbClientTrending.cs b/TMDbLib/Client/TMDbClientTrending.cs index f0134a6..265c49f 100644 --- a/TMDbLib/Client/TMDbClientTrending.cs +++ b/TMDbLib/Client/TMDbClientTrending.cs @@ -10,39 +10,45 @@ namespace TMDbLib.Client { public partial class TMDbClient { - public async Task> GetTrendingMoviesAsync(TimeWindow timeWindow, int page = 0, CancellationToken cancellationToken = default) + public async Task> GetTrendingMoviesAsync(TimeWindow timeWindow, int page = 0, string language = null, CancellationToken cancellationToken = default) { RestRequest req = _client.Create("trending/movie/{time_window}"); req.AddUrlSegment("time_window", timeWindow.GetDescription()); if (page >= 1) req.AddQueryString("page", page.ToString()); + if (language != null) + req.AddQueryString("language", language); SearchContainer resp = await req.GetOfT>(cancellationToken).ConfigureAwait(false); return resp; } - public async Task> GetTrendingTvAsync(TimeWindow timeWindow, int page = 0, CancellationToken cancellationToken = default) + public async Task> GetTrendingTvAsync(TimeWindow timeWindow, int page = 0, string language = null, CancellationToken cancellationToken = default) { RestRequest req = _client.Create("trending/tv/{time_window}"); req.AddUrlSegment("time_window", timeWindow.GetDescription()); if (page >= 1) req.AddQueryString("page", page.ToString()); + if (language != null) + req.AddQueryString("language", language); SearchContainer resp = await req.GetOfT>(cancellationToken).ConfigureAwait(false); return resp; } - public async Task> GetTrendingPeopleAsync(TimeWindow timeWindow, int page = 0, CancellationToken cancellationToken = default) + public async Task> GetTrendingPeopleAsync(TimeWindow timeWindow, int page = 0, string language = null, CancellationToken cancellationToken = default) { RestRequest req = _client.Create("trending/person/{time_window}"); req.AddUrlSegment("time_window", timeWindow.GetDescription()); if (page >= 1) req.AddQueryString("page", page.ToString()); + if (language != null) + req.AddQueryString("language", language); SearchContainer resp = await req.GetOfT>(cancellationToken).ConfigureAwait(false);