From 53812c1921a87a77d0420bd49ed13fde974b34f1 Mon Sep 17 00:00:00 2001 From: Carp <6675996+wickedhanzo@users.noreply.github.com> Date: Wed, 15 Sep 2021 23:47:10 +0200 Subject: [PATCH] Add Authordetails to Reviews --- TMDbLib/Objects/Reviews/AuthorDetails.cs | 19 +++++++++++++++++++ TMDbLib/Objects/Reviews/ReviewBase.cs | 4 ++++ ...sts.TestMoviesGetMovieReviews.verified.txt | 6 ++++++ ...ewTests.TestReviewFullDetails.verified.txt | 6 ++++++ ...TvShowTests.TestTvShowReviews.verified.txt | 5 +++++ 5 files changed, 40 insertions(+) create mode 100644 TMDbLib/Objects/Reviews/AuthorDetails.cs diff --git a/TMDbLib/Objects/Reviews/AuthorDetails.cs b/TMDbLib/Objects/Reviews/AuthorDetails.cs new file mode 100644 index 0000000..04913a3 --- /dev/null +++ b/TMDbLib/Objects/Reviews/AuthorDetails.cs @@ -0,0 +1,19 @@ +using Newtonsoft.Json; + +namespace TMDbLib.Objects.Reviews +{ + public class AuthorDetails + { + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("username")] + public string Username { get; set; } + + [JsonProperty("avatar_path")] + public string AvatarPath { get; set; } + + [JsonProperty("rating")] + public string Rating { get; set; } + } +} \ No newline at end of file diff --git a/TMDbLib/Objects/Reviews/ReviewBase.cs b/TMDbLib/Objects/Reviews/ReviewBase.cs index 73c6938..590f025 100644 --- a/TMDbLib/Objects/Reviews/ReviewBase.cs +++ b/TMDbLib/Objects/Reviews/ReviewBase.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using TMDbLib.Objects.Reviews; namespace TMDbLib.Objects.Reviews { @@ -7,6 +8,9 @@ namespace TMDbLib.Objects.Reviews [JsonProperty("author")] public string Author { get; set; } + [JsonProperty("author_details")] + public AuthorDetails AuthorDetails { get; set; } + [JsonProperty("content")] public string Content { get; set; } diff --git a/TMDbLibTests/Verification/ClientMovieTests.TestMoviesGetMovieReviews.verified.txt b/TMDbLibTests/Verification/ClientMovieTests.TestMoviesGetMovieReviews.verified.txt index 80f1e71..61c07db 100644 --- a/TMDbLibTests/Verification/ClientMovieTests.TestMoviesGetMovieReviews.verified.txt +++ b/TMDbLibTests/Verification/ClientMovieTests.TestMoviesGetMovieReviews.verified.txt @@ -1,5 +1,11 @@ { author: Per Gunnar Jonsson, + author_details: { + name: Per Gunnar Jonsson, + username: Dark Jedi, + avatar_path: /https://secure.gravatar.com/avatar/cbabaea0fa98692d00130498d7ac5d7c.jpg, + rating: 4.0 + }, content: My god what a disappointment! The original movie had a script worth watching and some good action and special effects. This one, well this was a typical Hollywood script written by someone who either was incredibly stupid or just too arrogant to care. It is a script that I would expect from a SyFy channel production. diff --git a/TMDbLibTests/Verification/ClientReviewTests.TestReviewFullDetails.verified.txt b/TMDbLibTests/Verification/ClientReviewTests.TestReviewFullDetails.verified.txt index 9a35bef..46c0068 100644 --- a/TMDbLibTests/Verification/ClientReviewTests.TestReviewFullDetails.verified.txt +++ b/TMDbLibTests/Verification/ClientReviewTests.TestReviewFullDetails.verified.txt @@ -4,6 +4,12 @@ media_title: The Dark Knight Rises, media_type: movie, author: Travis Bell, + author_details: { + name: Travis Bell, + username: travisbell, + avatar_path: /xy44UvpbTgzs9kWmp4C3fEaCl5h.png, + rating: 9.0 + }, content: I felt like this was a tremendous end to Nolan's Batman trilogy. The Dark Knight Rises may very well have been the weakest of all 3 films but when you're talking about a scale of this magnitude, it still makes this one of the best movies I've seen in the past few years. diff --git a/TMDbLibTests/Verification/ClientTvShowTests.TestTvShowReviews.verified.txt b/TMDbLibTests/Verification/ClientTvShowTests.TestTvShowReviews.verified.txt index ca83d31..d5b7040 100644 --- a/TMDbLibTests/Verification/ClientTvShowTests.TestTvShowReviews.verified.txt +++ b/TMDbLibTests/Verification/ClientTvShowTests.TestTvShowReviews.verified.txt @@ -1,5 +1,10 @@ { author: slyone10001, + author_details: { + name: , + username: slyone10001, + rating: 10.0 + }, content: Wow....where to start. Not really into "DRUG" inspired shows. But this one had me from the start. The only bad about this show was the split seasons when it was a first run show. But now you can go right through to the next episode with out having to wait.....MUST WATCH ! !, id: 5accdbe6c3a3687e2702d058, url: https://www.themoviedb.org/review/5accdbe6c3a3687e2702d058