Skip to content

Commit

Permalink
Add missing Person Translations
Browse files Browse the repository at this point in the history
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. 😅
  • Loading branch information
revam committed Mar 10, 2024
1 parent 32ee2f0 commit 4093aad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions TMDbLib/Client/TMDbClientPeople.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,10 @@ public async Task<TvCredits> GetPersonTvCreditsAsync(int personId, string langua
{
return await GetPersonMethodInternal<TvCredits>(personId, PersonMethods.TvCredits, language: language, cancellationToken: cancellationToken).ConfigureAwait(false);
}

public async Task<TranslationsContainer> GePersonTranslationsAsync(int personId, CancellationToken cancellationToken = default)
{
return await GetPersonMethodInternal<TranslationsContainer>(personId, PersonMethods.Translations, cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}
3 changes: 3 additions & 0 deletions TMDbLib/Objects/People/Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,8 @@ public class Person

[JsonProperty("tv_credits")]
public TvCredits TvCredits { get; set; }

[JsonProperty("translations")]
public TranslationsContainer Translations { get; set; }
}
}
4 changes: 3 additions & 1 deletion TMDbLib/Objects/People/PersonMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public enum PersonMethods
[EnumValue("tagged_images")]
TaggedImages = 16,
[EnumValue("changes")]
Changes = 32
Changes = 32,
[EnumValue("translations")]
Translations = 64,
}
}

0 comments on commit 4093aad

Please sign in to comment.