Add default language to trending queries

This commit is contained in:
Szajkop 2023-03-16 17:45:15 +01:00
parent 6420364178
commit 8b5051ae4d

View File

@ -1,6 +1,7 @@
using System.Threading;
using System.Threading.Tasks;
using TMDbLib.Objects.General;
using TMDbLib.Objects.Languages;
using TMDbLib.Objects.Search;
using TMDbLib.Objects.Trending;
using TMDbLib.Rest;
@ -18,6 +19,9 @@ namespace TMDbLib.Client
if (page >= 1)
req.AddQueryString("page", page.ToString());
if (!string.IsNullOrWhiteSpace(DefaultLanguage))
req.AddParameter("language", DefaultLanguage);
SearchContainer<SearchMovie> resp = await req.GetOfT<SearchContainer<SearchMovie>>(cancellationToken).ConfigureAwait(false);
return resp;
@ -31,6 +35,9 @@ namespace TMDbLib.Client
if (page >= 1)
req.AddQueryString("page", page.ToString());
if (!string.IsNullOrWhiteSpace(DefaultLanguage))
req.AddParameter("language", DefaultLanguage);
SearchContainer<SearchTv> resp = await req.GetOfT<SearchContainer<SearchTv>>(cancellationToken).ConfigureAwait(false);
return resp;
@ -44,6 +51,9 @@ namespace TMDbLib.Client
if (page >= 1)
req.AddQueryString("page", page.ToString());
if (!string.IsNullOrWhiteSpace(DefaultLanguage))
req.AddParameter("language", DefaultLanguage);
SearchContainer<SearchPerson> resp = await req.GetOfT<SearchContainer<SearchPerson>>(cancellationToken).ConfigureAwait(false);
return resp;