Add missing Collection Translations

Found another thing missing I needed.

While I haven't actually tested if I hooked it up correctly from within
the library I have tested that the api accepts the 'translations' value
in the 'append_to_response' query parameter and sends the translations
with the other collection info.

Example output from the api;
![image](https://github.com/revam/dotnet-tmdblib/assets/7761729/804b284b-aced-4b02-b3be-846046970b40)
This commit is contained in:
Mikal Stordal 2023-09-17 10:49:40 +02:00
parent 2fa2e9df68
commit 208ee02881
3 changed files with 11 additions and 1 deletions

View File

@ -73,5 +73,10 @@ namespace TMDbLib.Client
{
return await GetCollectionMethodInternal<ImagesWithId>(collectionId, CollectionMethods.Images, language, cancellationToken).ConfigureAwait(false);
}
public async Task<TranslationsContainer> GetCollectionTranslationsAsync(int collecitonId, CancellationToken cancellationToken = default)
{
return await GetCollectionMethodInternal<TranslationsContainer>(collecitonId, CollectionMethods.Translations, null, cancellationToken).ConfigureAwait(false);
}
}
}

View File

@ -16,6 +16,9 @@ namespace TMDbLib.Objects.Collections
[JsonProperty("images")]
public Images Images { get; set; }
[JsonProperty("translations")]
public TranslationsContainer Translations { get; set; }
[JsonProperty("name")]
public string Name { get; set; }

View File

@ -9,6 +9,8 @@ namespace TMDbLib.Objects.Collections
[EnumValue("Undefined")]
Undefined = 0,
[EnumValue("images")]
Images = 1
Images = 1,
[EnumValue("translations")]
Translations = 2,
}
}