mirror of
https://github.com/jellyfin/TMDbLib.git
synced 2024-11-23 05:40:12 +00:00
Merge pull request #434 from Szajkop/master
Add default language to trending queries
This commit is contained in:
commit
3bf0087833
@ -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;
|
||||
@ -17,8 +18,11 @@ namespace TMDbLib.Client
|
||||
|
||||
if (page >= 1)
|
||||
req.AddQueryString("page", page.ToString());
|
||||
if (language != null)
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(language))
|
||||
req.AddQueryString("language", language);
|
||||
else if (!string.IsNullOrWhiteSpace(DefaultLanguage))
|
||||
req.AddParameter("language", DefaultLanguage);
|
||||
|
||||
SearchContainer<SearchMovie> resp = await req.GetOfT<SearchContainer<SearchMovie>>(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@ -32,8 +36,11 @@ namespace TMDbLib.Client
|
||||
|
||||
if (page >= 1)
|
||||
req.AddQueryString("page", page.ToString());
|
||||
if (language != null)
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(language))
|
||||
req.AddQueryString("language", language);
|
||||
else if (!string.IsNullOrWhiteSpace(DefaultLanguage))
|
||||
req.AddParameter("language", DefaultLanguage);
|
||||
|
||||
SearchContainer<SearchTv> resp = await req.GetOfT<SearchContainer<SearchTv>>(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@ -47,8 +54,11 @@ namespace TMDbLib.Client
|
||||
|
||||
if (page >= 1)
|
||||
req.AddQueryString("page", page.ToString());
|
||||
if (language != null)
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(language))
|
||||
req.AddQueryString("language", language);
|
||||
else if (!string.IsNullOrWhiteSpace(DefaultLanguage))
|
||||
req.AddParameter("language", DefaultLanguage);
|
||||
|
||||
SearchContainer<SearchPerson> resp = await req.GetOfT<SearchContainer<SearchPerson>>(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@ -62,8 +72,11 @@ namespace TMDbLib.Client
|
||||
|
||||
if (page >= 1)
|
||||
req.AddQueryString("page", page.ToString());
|
||||
if (language != null)
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(language))
|
||||
req.AddQueryString("language", language);
|
||||
else if (!string.IsNullOrWhiteSpace(DefaultLanguage))
|
||||
req.AddParameter("language", DefaultLanguage);
|
||||
|
||||
SearchContainer<SearchBase> resp = await req.GetOfT<SearchContainer<SearchBase>>(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user