Added missing review method

This commit is contained in:
Stuart Boston
2015-03-03 21:54:51 +00:00
parent 577a25c81f
commit 4f32632e52
4 changed files with 41 additions and 30 deletions
@@ -30,6 +30,7 @@ import com.omertron.themoviedbapi.model2.list.UserList;
import com.omertron.themoviedbapi.model2.movie.MovieBasic;
import com.omertron.themoviedbapi.model2.person.Person;
import com.omertron.themoviedbapi.model2.person.PersonFind;
import com.omertron.themoviedbapi.model2.review.Review;
import com.omertron.themoviedbapi.model2.tv.TVBasic;
import com.omertron.themoviedbapi.tools.HttpTools;
import com.omertron.themoviedbapi.wrapper.WrapperGenericList;
@@ -79,6 +80,8 @@ public class AbstractMethod {
});
TYPE_REFS.put(PersonFind.class, new TypeReference<WrapperGenericList<PersonFind>>() {
});
TYPE_REFS.put(Review.class, new TypeReference<WrapperGenericList<Review>>() {
});
}
/**
@@ -32,6 +32,7 @@ import com.omertron.themoviedbapi.model2.keyword.Keyword;
import com.omertron.themoviedbapi.model2.list.UserList;
import com.omertron.themoviedbapi.model2.media.MediaCreditList;
import com.omertron.themoviedbapi.model2.movie.AlternativeTitle;
import com.omertron.themoviedbapi.model2.review.Review;
import com.omertron.themoviedbapi.results.TmdbResultsList;
import com.omertron.themoviedbapi.tools.ApiUrl;
import com.omertron.themoviedbapi.tools.HttpTools;
@@ -43,6 +44,7 @@ import com.omertron.themoviedbapi.tools.PostTools;
import com.omertron.themoviedbapi.tools.TmdbParameters;
import com.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles;
import com.omertron.themoviedbapi.wrapper.WrapperChanges;
import com.omertron.themoviedbapi.wrapper.WrapperGenericList;
import com.omertron.themoviedbapi.wrapper.WrapperImages;
import com.omertron.themoviedbapi.wrapper.WrapperMovie;
import com.omertron.themoviedbapi.wrapper.WrapperMovieKeywords;
@@ -397,16 +399,19 @@ public class TmdbMovies extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public String getMovieReviews(int movieId, Integer page, String language, String... appendToResponse) throws MovieDbException {
public TmdbResultsList<Review> getMovieReviews(int movieId, Integer page, String language, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.PAGE, page);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.APPEND, appendToResponse);
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
return null;
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).setSubMethod(MethodSub.REVIEWS).buildUrl(parameters);
WrapperGenericList<Review> wrapper = processWrapper(getTypeReference(Review.class), url, "review");
TmdbResultsList<Review> results = new TmdbResultsList<Review>(null);
results.getResults().addAll(wrapper.getResults());
results.copyWrapper(wrapper);
return results;
}
/**
@@ -66,7 +66,7 @@ Lists (Done)
/list/{id}/remove_item This method lets users delete movies from a list that they created. A valid session id is required.
/list/{id}/clear Clear all of the items within a list. This is a irreversible action and should be treated with caution. A valid session id is required.
Movies
Movies (Done)
/movie/{id} Get the basic movie information for a specific movie id.
/movie/{id}/account_states This method lets a TMDb user account get the status of whether or not the movie has been rated or added to their favourite or movie watch list
/movie/{id}/alternative_titles Get the alternative titles for a specific movie id.
@@ -105,13 +105,13 @@ People (Done)
Reviews (Done)
/review/{id} Get the full details of a review by ID.
Search (Partial - multi search to do)
Search (Done)
/search/company Search for companies by name.
/search/collection Search for collections by name.
/search/keyword Search for keywords by name.
/search/list Search for lists by name and description.
/search/movie Search for movies by title.
*** /search/multi Search the movie, tv show and person collections with a single query.
/search/multi Search the movie, tv show and person collections with a single query.
/search/person Search for people by name.
/search/tv Search for TV shows by title.