From 4093aadf189f1aec1525897f653d2294550f2bab Mon Sep 17 00:00:00 2001 From: Mikal Stordal Date: Sun, 10 Mar 2024 21:18:05 +0100 Subject: [PATCH] Add missing Person Translations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And I found another endpoint/method missing that I needed, this time for the people. I did a PR for mapping the person bio. to overview previously, but forgot to check if the methods/endpoints to get the translation was mapped… which they were not… so here I am again, with another PR. 😅 --- TMDbLib/Client/TMDbClientPeople.cs | 5 +++++ TMDbLib/Objects/People/Person.cs | 3 +++ TMDbLib/Objects/People/PersonMethods.cs | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/TMDbLib/Client/TMDbClientPeople.cs b/TMDbLib/Client/TMDbClientPeople.cs index 9f94280..db4b400 100644 --- a/TMDbLib/Client/TMDbClientPeople.cs +++ b/TMDbLib/Client/TMDbClientPeople.cs @@ -160,5 +160,10 @@ namespace TMDbLib.Client { return await GetPersonMethodInternal(personId, PersonMethods.TvCredits, language: language, cancellationToken: cancellationToken).ConfigureAwait(false); } + + public async Task GePersonTranslationsAsync(int personId, CancellationToken cancellationToken = default) + { + return await GetPersonMethodInternal(personId, PersonMethods.Translations, cancellationToken: cancellationToken).ConfigureAwait(false); + } } } \ No newline at end of file diff --git a/TMDbLib/Objects/People/Person.cs b/TMDbLib/Objects/People/Person.cs index c090f60..0d3afa7 100644 --- a/TMDbLib/Objects/People/Person.cs +++ b/TMDbLib/Objects/People/Person.cs @@ -70,5 +70,8 @@ namespace TMDbLib.Objects.People [JsonProperty("tv_credits")] public TvCredits TvCredits { get; set; } + + [JsonProperty("translations")] + public TranslationsContainer Translations { get; set; } } } \ No newline at end of file diff --git a/TMDbLib/Objects/People/PersonMethods.cs b/TMDbLib/Objects/People/PersonMethods.cs index 571f5b3..1c8e412 100644 --- a/TMDbLib/Objects/People/PersonMethods.cs +++ b/TMDbLib/Objects/People/PersonMethods.cs @@ -19,6 +19,8 @@ namespace TMDbLib.Objects.People [EnumValue("tagged_images")] TaggedImages = 16, [EnumValue("changes")] - Changes = 32 + Changes = 32, + [EnumValue("translations")] + Translations = 64, } } \ No newline at end of file