Skip to content

Commit

Permalink
Merge pull request #446 from revam/patch-4
Browse files Browse the repository at this point in the history
Add missing Collection Translations
  • Loading branch information
cvium authored Sep 17, 2023
2 parents fbf6e7e + d750552 commit 0905c54
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions TMDbLib/Client/TMDbClientCollections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,10 @@ public async Task<ImagesWithId> GetCollectionImagesAsync(int collectionId, strin
{
return await GetCollectionMethodInternal<ImagesWithId>(collectionId, CollectionMethods.Images, language, cancellationToken).ConfigureAwait(false);
}

public async Task<TranslationsContainer> GetCollectionTranslationsAsync(int collectionId, CancellationToken cancellationToken = default)
{
return await GetCollectionMethodInternal<TranslationsContainer>(collectionId, CollectionMethods.Translations, null, cancellationToken).ConfigureAwait(false);
}
}
}
3 changes: 3 additions & 0 deletions TMDbLib/Objects/Collections/Collection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public class Collection
[JsonProperty("images")]
public Images Images { get; set; }

[JsonProperty("translations")]
public TranslationsContainer Translations { get; set; }

[JsonProperty("name")]
public string Name { get; set; }

Expand Down
4 changes: 3 additions & 1 deletion TMDbLib/Objects/Collections/CollectionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public enum CollectionMethods
[EnumValue("Undefined")]
Undefined = 0,
[EnumValue("images")]
Images = 1
Images = 1,
[EnumValue("translations")]
Translations = 2,
}
}

0 comments on commit 0905c54

Please sign in to comment.