Merge pull request #346 from cvium/collection_image_language

Add image languages to collections
This commit is contained in:
Michael Bisbjerg 2020-10-03 19:35:16 +02:00 committed by GitHub
commit 1fecac67bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,10 +14,10 @@ namespace TMDbLib.Client
{
public async Task<Collection> GetCollectionAsync(int collectionId, CollectionMethods extraMethods = CollectionMethods.Undefined, CancellationToken cancellationToken = default(CancellationToken))
{
return await GetCollectionAsync(collectionId, DefaultLanguage, extraMethods, cancellationToken).ConfigureAwait(false);
return await GetCollectionAsync(collectionId, DefaultLanguage, null, extraMethods, cancellationToken).ConfigureAwait(false);
}
public async Task<Collection> GetCollectionAsync(int collectionId, string language, CollectionMethods extraMethods = CollectionMethods.Undefined, CancellationToken cancellationToken = default(CancellationToken))
public async Task<Collection> GetCollectionAsync(int collectionId, string language, string includeImageLanguages, CollectionMethods extraMethods = CollectionMethods.Undefined, CancellationToken cancellationToken = default(CancellationToken))
{
RestRequest req = _client.Create("collection/{collectionId}");
req.AddUrlSegment("collectionId", collectionId.ToString());
@ -26,6 +26,10 @@ namespace TMDbLib.Client
if (!string.IsNullOrWhiteSpace(language))
req.AddParameter("language", language);
includeImageLanguages = includeImageLanguages ?? DefaultImageLanguage;
if (!string.IsNullOrWhiteSpace(includeImageLanguages))
req.AddParameter("include_image_language", includeImageLanguages);
string appends = string.Join(",",
Enum.GetValues(typeof(CollectionMethods))
.OfType<CollectionMethods>()