Result lists

master
Stuart Boston 11 years ago
parent a89cd9c923
commit 564b00f423

@ -51,6 +51,7 @@ import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.artwork.ArtworkMedia;
import com.omertron.themoviedbapi.model.authentication.TokenAuthorisation;
import com.omertron.themoviedbapi.model.authentication.TokenSession;
import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.change.ChangeListItem;
import com.omertron.themoviedbapi.model.collection.Collection;
import com.omertron.themoviedbapi.model.collection.CollectionInfo;
@ -84,10 +85,8 @@ import com.omertron.themoviedbapi.results.ResultList;
import com.omertron.themoviedbapi.results.ResultsMap;
import com.omertron.themoviedbapi.tools.HttpTools;
import com.omertron.themoviedbapi.tools.MethodBase;
import com.omertron.themoviedbapi.wrapper.WrapperChanges;
import java.net.URL;
import java.util.List;
import java.util.Map;
import org.apache.http.client.HttpClient;
import org.yamj.api.common.http.SimpleHttpClientBuilder;
@ -585,7 +584,7 @@ public class TheMovieDbApi {
*
* @return @throws MovieDbException
*/
public Map<String, List<String>> getTimezones() throws MovieDbException {
public ResultsMap<String, List<String>> getTimezones() throws MovieDbException {
return tmdbConfiguration.getTimezones();
}
//</editor-fold>
@ -624,7 +623,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public List<MovieBasic> getDiscoverMovies(Discover discover) throws MovieDbException {
public ResultList<MovieBasic> getDiscoverMovies(Discover discover) throws MovieDbException {
return tmdbDiscover.getDiscoverMovies(discover);
}
@ -636,7 +635,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public List<TVBasic> getDiscoverTV(Discover discover) throws MovieDbException {
public ResultList<TVBasic> getDiscoverTV(Discover discover) throws MovieDbException {
return tmdbDiscover.getDiscoverTV(discover);
}
//</editor-fold>
@ -710,7 +709,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public List<MovieBasic> getGenreMovies(int genreId, String language, Integer page, Boolean includeAllMovies, Boolean includeAdult) throws MovieDbException {
public ResultList<MovieBasic> getGenreMovies(int genreId, String language, Integer page, Boolean includeAllMovies, Boolean includeAdult) throws MovieDbException {
return tmdbGenre.getGenreMovies(genreId, language, page, includeAllMovies, includeAdult);
}
//</editor-fold>
@ -1038,7 +1037,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public WrapperChanges getMovieChanges(int movieId, String startDate, String endDate) throws MovieDbException {
public ResultList<ChangeKeyItem> getMovieChanges(int movieId, String startDate, String endDate) throws MovieDbException {
return tmdbMovies.getMovieChanges(movieId, startDate, endDate);
}
@ -1264,7 +1263,7 @@ public class TheMovieDbApi {
* @return
* @throws com.omertron.themoviedbapi.MovieDbException
*/
public WrapperChanges getPersonChanges(int personId, String startDate, String endDate) throws MovieDbException {
public ResultList<ChangeKeyItem> getPersonChanges(int personId, String startDate, String endDate) throws MovieDbException {
return tmdbPeople.getPersonChanges(personId, startDate, endDate);
}
@ -1487,7 +1486,7 @@ public class TheMovieDbApi {
* @return
* @throws com.omertron.themoviedbapi.MovieDbException
*/
public WrapperChanges getTVChanges(int tvID, String startDate, String endDate) throws MovieDbException {
public ResultList<ChangeKeyItem> getTVChanges(int tvID, String startDate, String endDate) throws MovieDbException {
return tmdbTv.getTVChanges(tvID, startDate, endDate);
}
@ -1675,10 +1674,11 @@ public class TheMovieDbApi {
public ResultList<TVBasic> getTVPopular(Integer page, String language) throws MovieDbException {
return tmdbTv.getTVPopular(page, language);
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="TV Seasons">
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="TV Episodes">
//</editor-fold>
}

@ -25,6 +25,7 @@ import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER;
import com.omertron.themoviedbapi.model.config.Configuration;
import com.omertron.themoviedbapi.model.config.JobDepartment;
import com.omertron.themoviedbapi.results.ResultList;
import com.omertron.themoviedbapi.results.ResultsMap;
import com.omertron.themoviedbapi.tools.ApiUrl;
import com.omertron.themoviedbapi.tools.HttpTools;
import com.omertron.themoviedbapi.tools.MethodBase;
@ -33,7 +34,6 @@ import com.omertron.themoviedbapi.wrapper.WrapperConfig;
import com.omertron.themoviedbapi.wrapper.WrapperJobList;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.yamj.api.common.exception.ApiExceptionType;
@ -109,7 +109,7 @@ public class TmdbConfiguration extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public Map<String, List<String>> getTimezones() throws MovieDbException {
public ResultsMap<String, List<String>> getTimezones() throws MovieDbException {
URL url = new ApiUrl(apiKey, MethodBase.TIMEZONES).subMethod(MethodSub.LIST).buildUrl();
String webpage = httpTools.getRequest(url);
@ -121,7 +121,7 @@ public class TmdbConfiguration extends AbstractMethod {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get timezone list", url, ex);
}
Map<String, List<String>> timezones = new HashMap<String, List<String>>();
ResultsMap<String, List<String>> timezones = new ResultsMap<String, List<String>>();
for (Map<String, List<String>> tzMap : tzList) {
for (Map.Entry<String, List<String>> x : tzMap.entrySet()) {

@ -23,12 +23,13 @@ import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.model.discover.Discover;
import com.omertron.themoviedbapi.model.movie.MovieBasic;
import com.omertron.themoviedbapi.model.tv.TVBasic;
import com.omertron.themoviedbapi.results.ResultList;
import com.omertron.themoviedbapi.tools.ApiUrl;
import com.omertron.themoviedbapi.tools.HttpTools;
import com.omertron.themoviedbapi.tools.MethodBase;
import com.omertron.themoviedbapi.tools.MethodSub;
import com.omertron.themoviedbapi.wrapper.WrapperGenericList;
import java.net.URL;
import java.util.List;
/**
* Class to hold the Discover Methods
@ -54,10 +55,11 @@ public class TmdbDiscover extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public List<MovieBasic> getDiscoverMovies(Discover discover) throws MovieDbException {
public ResultList<MovieBasic> getDiscoverMovies(Discover discover) throws MovieDbException {
URL url = new ApiUrl(apiKey, MethodBase.DISCOVER).subMethod(MethodSub.MOVIE).buildUrl(discover.getParams());
String webpage = httpTools.getRequest(url);
return processWrapperList(getTypeReference(MovieBasic.class), url, webpage);
WrapperGenericList<MovieBasic> wrapper = processWrapper(getTypeReference(MovieBasic.class), url, webpage);
return wrapper.getResultsList();
}
/**
@ -67,9 +69,10 @@ public class TmdbDiscover extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public List<TVBasic> getDiscoverTV(Discover discover) throws MovieDbException {
public ResultList<TVBasic> getDiscoverTV(Discover discover) throws MovieDbException {
URL url = new ApiUrl(apiKey, MethodBase.DISCOVER).subMethod(MethodSub.TV).buildUrl(discover.getParams());
String webpage = httpTools.getRequest(url);
return processWrapperList(getTypeReference(TVBasic.class), url, webpage);
WrapperGenericList<TVBasic> wrapper = processWrapper(getTypeReference(TVBasic.class), url, webpage);
return wrapper.getResultsList();
}
}

@ -29,10 +29,10 @@ import com.omertron.themoviedbapi.tools.MethodBase;
import com.omertron.themoviedbapi.tools.MethodSub;
import com.omertron.themoviedbapi.tools.Param;
import com.omertron.themoviedbapi.tools.TmdbParameters;
import com.omertron.themoviedbapi.wrapper.WrapperGenericList;
import com.omertron.themoviedbapi.wrapper.WrapperGenres;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import org.yamj.api.common.exception.ApiExceptionType;
/**
@ -112,7 +112,7 @@ public class TmdbGenres extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public List<MovieBasic> getGenreMovies(int genreId, String language, Integer page, Boolean includeAllMovies, Boolean includeAdult) throws MovieDbException {
public ResultList<MovieBasic> getGenreMovies(int genreId, String language, Integer page, Boolean includeAllMovies, Boolean includeAdult) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, genreId);
parameters.add(Param.LANGUAGE, language);
@ -123,6 +123,7 @@ public class TmdbGenres extends AbstractMethod {
URL url = new ApiUrl(apiKey, MethodBase.GENRE).subMethod(MethodSub.MOVIES).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
return processWrapperList(getTypeReference(MovieBasic.class), url, webpage);
WrapperGenericList<MovieBasic> wrapper = processWrapper(getTypeReference(MovieBasic.class), url, webpage);
return wrapper.getResultsList();
}
}

@ -23,6 +23,7 @@ import com.omertron.themoviedbapi.MovieDbException;
import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER;
import com.omertron.themoviedbapi.model.StatusCode;
import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.keyword.Keyword;
import com.omertron.themoviedbapi.model.list.UserList;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
@ -78,8 +79,7 @@ public class TmdbMovies extends AbstractMethod {
*
* It will return the single highest rated poster and backdrop.
*
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
* found.
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
*
* @param movieId
* @param language
@ -111,8 +111,7 @@ public class TmdbMovies extends AbstractMethod {
*
* It will return the single highest rated poster and backdrop.
*
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
* found.
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
*
* @param imdbId
* @param language
@ -141,8 +140,8 @@ public class TmdbMovies extends AbstractMethod {
}
/**
* This method lets a user get the status of whether or not the movie has
* been rated or added to their favourite or movie watch list.
* This method lets a user get the status of whether or not the movie has been rated or added to their favourite or movie watch
* list.
*
* A valid session id is required.
*
@ -167,8 +166,7 @@ public class TmdbMovies extends AbstractMethod {
}
/**
* This method is used to retrieve all of the alternative titles we have for
* a particular movie.
* This method is used to retrieve all of the alternative titles we have for a particular movie.
*
* @param movieId
* @param country
@ -217,8 +215,7 @@ public class TmdbMovies extends AbstractMethod {
}
/**
* This method should be used when youre wanting to retrieve all of the
* images for a particular movie.
* This method should be used when youre wanting to retrieve all of the images for a particular movie.
*
* @param movieId
* @param language
@ -246,8 +243,7 @@ public class TmdbMovies extends AbstractMethod {
}
/**
* This method is used to retrieve all of the keywords that have been added
* to a particular movie.
* This method is used to retrieve all of the keywords that have been added to a particular movie.
*
* Currently, only English keywords exist.
*
@ -275,8 +271,7 @@ public class TmdbMovies extends AbstractMethod {
}
/**
* This method is used to retrieve all of the release and certification data
* we have for a specific movie.
* This method is used to retrieve all of the release and certification data we have for a specific movie.
*
* @param movieId
* @param language
@ -304,8 +299,7 @@ public class TmdbMovies extends AbstractMethod {
}
/**
* This method is used to retrieve all of the trailers for a particular
* movie.
* This method is used to retrieve all of the trailers for a particular movie.
*
* Supported sites are YouTube and QuickTime.
*
@ -335,8 +329,7 @@ public class TmdbMovies extends AbstractMethod {
}
/**
* This method is used to retrieve a list of the available translations for
* a specific movie.
* This method is used to retrieve a list of the available translations for a specific movie.
*
* @param movieId
* @param appendToResponse
@ -362,11 +355,9 @@ public class TmdbMovies extends AbstractMethod {
}
/**
* The similar movies method will let you retrieve the similar movies for a
* particular movie.
* The similar movies method will let you retrieve the similar movies for a particular movie.
*
* This data is created dynamically but with the help of users votes on
* TMDb.
* This data is created dynamically but with the help of users votes on TMDb.
*
* The data is much better with movies that have more keywords
*
@ -440,8 +431,7 @@ public class TmdbMovies extends AbstractMethod {
*
* By default, only the last 24 hours of changes are returned.
*
* The maximum number of days that can be returned in a single request is
* 14.
* The maximum number of days that can be returned in a single request is 14.
*
* The language is present on fields that are translatable.
*
@ -451,7 +441,7 @@ public class TmdbMovies extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public WrapperChanges getMovieChanges(int movieId, String startDate, String endDate) throws MovieDbException {
public ResultList<ChangeKeyItem> getMovieChanges(int movieId, String startDate, String endDate) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.START_DATE, startDate);
@ -461,7 +451,10 @@ public class TmdbMovies extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, WrapperChanges.class);
WrapperChanges wrapper = MAPPER.readValue(webpage, WrapperChanges.class);
ResultList<ChangeKeyItem> results = new ResultList<ChangeKeyItem>(wrapper.getChangedItems());
wrapper.setResultProperties(results);
return results;
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get changes", url, ex);
}
@ -545,8 +538,7 @@ public class TmdbMovies extends AbstractMethod {
/**
* This method is used to retrieve the movies currently in theatres.
*
* This is a curated list that will normally contain 100 movies. The default
* response will return 20 movies.
* This is a curated list that will normally contain 100 movies. The default response will return 20 movies.
*
* @param language
* @param page
@ -584,8 +576,7 @@ public class TmdbMovies extends AbstractMethod {
}
/**
* This method is used to retrieve the top rated movies that have over 10
* votes on TMDb.
* This method is used to retrieve the top rated movies that have over 10 votes on TMDb.
*
* The default response will return 20 movies.
*

@ -23,8 +23,10 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.enumeration.ArtworkType;
import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER;
import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.artwork.ArtworkMedia;
import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.person.CreditBasic;
import com.omertron.themoviedbapi.model.person.CreditMovieBasic;
import com.omertron.themoviedbapi.model.person.CreditTVBasic;
@ -268,7 +270,7 @@ public class TmdbPeople extends AbstractMethod {
* @return
* @throws com.omertron.themoviedbapi.MovieDbException
*/
public WrapperChanges getPersonChanges(int personId, String startDate, String endDate) throws MovieDbException {
public ResultList<ChangeKeyItem> getPersonChanges(int personId, String startDate, String endDate) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.START_DATE, startDate);
@ -278,7 +280,10 @@ public class TmdbPeople extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, WrapperChanges.class);
WrapperChanges wrapper = MAPPER.readValue(webpage, WrapperChanges.class);
ResultList<ChangeKeyItem> results = new ResultList<ChangeKeyItem>(wrapper.getChangedItems());
wrapper.setResultProperties(results);
return results;
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person changes", url, ex);
}

@ -23,6 +23,7 @@ import com.omertron.themoviedbapi.MovieDbException;
import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER;
import com.omertron.themoviedbapi.model.StatusCode;
import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.keyword.Keyword;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
import com.omertron.themoviedbapi.model.media.MediaState;
@ -146,7 +147,7 @@ public class TmdbTV extends AbstractMethod {
* @return
* @throws com.omertron.themoviedbapi.MovieDbException
*/
public WrapperChanges getTVChanges(int tvID, String startDate, String endDate) throws MovieDbException {
public ResultList<ChangeKeyItem> getTVChanges(int tvID, String startDate, String endDate) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, tvID);
parameters.add(Param.START_DATE, startDate);
@ -156,7 +157,10 @@ public class TmdbTV extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, WrapperChanges.class);
WrapperChanges wrapper = MAPPER.readValue(webpage, WrapperChanges.class);
ResultList<ChangeKeyItem> results = new ResultList<ChangeKeyItem>(wrapper.getChangedItems());
wrapper.setResultProperties(results);
return results;
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get changes", url, ex);
}

@ -23,6 +23,7 @@ import com.omertron.themoviedbapi.MovieDbException;
import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER;
import com.omertron.themoviedbapi.model.StatusCode;
import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
import com.omertron.themoviedbapi.model.media.MediaState;
import com.omertron.themoviedbapi.model.media.Video;
@ -104,7 +105,7 @@ public class TmdbTVEpisodes extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public WrapperChanges getEpisodeChanges(int episodeID, String startDate, String endDate) throws MovieDbException {
public ResultList<ChangeKeyItem> getEpisodeChanges(int episodeID, String startDate, String endDate) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, episodeID);
parameters.add(Param.START_DATE, startDate);
@ -114,7 +115,10 @@ public class TmdbTVEpisodes extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, WrapperChanges.class);
WrapperChanges wrapper = MAPPER.readValue(webpage, WrapperChanges.class);
ResultList<ChangeKeyItem> results = new ResultList<ChangeKeyItem>(wrapper.getChangedItems());
wrapper.setResultProperties(results);
return results;
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get changes", url, ex);
}

@ -22,6 +22,7 @@ package com.omertron.themoviedbapi.methods;
import com.omertron.themoviedbapi.MovieDbException;
import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER;
import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
import com.omertron.themoviedbapi.model.media.MediaState;
import com.omertron.themoviedbapi.model.media.Video;
@ -94,7 +95,7 @@ public class TmdbTVSeasons extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public WrapperChanges getSeasonChanges(int tvID, String startDate, String endDate) throws MovieDbException {
public ResultList<ChangeKeyItem> getSeasonChanges(int tvID, String startDate, String endDate) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, tvID);
parameters.add(Param.START_DATE, startDate);
@ -104,7 +105,10 @@ public class TmdbTVSeasons extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, WrapperChanges.class);
WrapperChanges wrapper = MAPPER.readValue(webpage, WrapperChanges.class);
ResultList<ChangeKeyItem> results = new ResultList<ChangeKeyItem>(wrapper.getChangedItems());
wrapper.setResultProperties(results);
return results;
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get changes", url, ex);
}

@ -1,157 +0,0 @@
Account (Done)
/account Get the basic information for an account. You will need to have a valid session id.
/account/{id}/lists Get the lists that you have created and marked as a favorite.
/account/{id}/favorite/movies Get the list of favorite movies for an account.
/account/{id}/favorite/tv Get the list of favorite TV series for an account
/account/{id}/favorite Add or remove a movie to an accounts favorite list
/account/{id}/rated/movies Get the list of rated movies (and associated rating) for an account
/account/{id}/rated/tv Get the list of rated TV shows (and associated rating) for an account.
/account/{id}/watchlist/movies Get the list of movies on an accounts watchlist
/account/{id}/watchlist/tv Get the list of TV series on an accounts watchlist
/account/{id}/watchlist Add or remove a movie to an accounts watch list
Authentication (Done)
/authentication/token/new This method is used to generate a valid request token for user based authentication
/authentication/token/validate_with_login Once you have a valid request token you can use this method to authenticate a user with a TMDb username and password.
/authentication/session/new This method is used to generate a session id for user based authentication. A session id is required in order to use any of the write methods.
/authentication/guest_session/new This method is used to generate a guest session id.A guest session can be used to rate movies without having a registered TMDb user account.
Certifications (Done)
/certification/movie/list Get the list of supported certifications for movies.
/certification/tv/list Get the list of supported certifications for tv shows
Changes (Done)
/movie/changes Get a list of movie ids that have been edited.
/person/changes Get a list of people ids that have been edited.
/tv/changes Get a list of TV show ids that have been edited
Collections (Done)
/collection/{id} Get the basic collection information for a specific collection id.
/collection/{id}/images Get all of the images for a particular collection by collection id.
Companies (Done)
/company/{id} This method is used to retrieve all of the basic information about a company
/company/{id}/movies Get the list of movies associated with a particular company.
Credits (Done)
/credit/{credit_id} Get the detailed information about a particular credit record.
Discover (Done)
/discover/movie Discover movies by different types of data like average rating, number of votes, genres and certifications.
/discover/tv Discover TV shows by different types of data like average rating, number of votes, genres, the network they aired on and air dates.
Find (Done)
/find/{id} The find method makes it easy to search for objects in our database by an external id.
Genres (Done)
/genre/movie/list Get the list of movie genres.
/genre/tv/list Get the list of TV genres.
/genre/{id}/movies Get the list of movies for a particular genre by id.
Guest Sessions (Partial - in Account)
/guest_session/{guest_session_id}/rated_movies Get a list of rated movies for a specific guest session id.
Jobs (Done - part of configuration)
/job/list Get a list of valid jobs.
Keyword (Done)
/keyword/{id} Get the basic information for a specific keyword id
/keyword/{id}/movies Get the list of movies for a particular keyword by id
Lists (Done)
/list/{id} Get a list by id.
/list/{id}/item_status Check to see if a movie ID is already added to a list.
/list This method lets users create a new list. A valid session id is required.
/list/{id}/add_item This method lets users add new movies to a list that they created. A valid session id is required.
/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 (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.
/movie/{id}/credits Get the cast and crew information for a specific movie id.
/movie/{id}/images Get the images (posters and backdrops) for a specific movie id.
/movie/{id}/keywords Get the plot keywords for a specific movie id.
/movie/{id}/releases Get the release date and certification information by country for a specific movie id.
/movie/{id}/videos Get the videos (trailers, teasers, clips, etc...) for a specific movie id.
/movie/{id}/translations Get the translations for a specific movie id.
/movie/{id}/similar Get the similar movies for a specific movie id.
/movie/{id}/reviews Get the reviews for a particular movie id.
/movie/{id}/lists Get the lists that the movie belongs to.
/movie/{id}/changes Get the changes for a specific movie id.
/movie/{id}/rating This method lets users rate a movie. A valid session id or guest session id is required.
/movie/latest Get the latest movie id.
/movie/upcoming Get the list of upcoming movies by release date. This list refreshes every day.
/movie/now_playing Get the list of movies playing that have been, or are being released this week. This list refreshes every day.
/movie/popular Get the list of popular movies on The Movie Database. This list refreshes every day.
/movie/top_rated Get the list of top rated movies. By default, this list will only include movies that have 10 or more votes. This list refreshes every day.
Networks (Done)
/network/{id} This method is used to retrieve the basic information about a TV network.
People (Done)
/person/{id} Get the general person information for a specific id
/person/{id}/movie_credits Get the movie credits for a specific person id.
/person/{id}/tv_credits Get the TV credits for a specific person id.
/person/{id}/combined_credits Get the combined (movie and TV) credits for a specific person id.
/person/{id}/external_ids Get the external ids for a specific person id.
/person/{id}/images Get the images for a specific person id.
/person/{id}/tagged_images Get the images that have been tagged with a specific person id
/person/{id}/changes Get the changes for a specific person id.
/person/popular Get the list of popular people on The Movie Database. This list refreshes every day.
/person/latest Get the latest person id.
Reviews (Done)
/review/{id} Get the full details of a review by ID.
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/person Search for people by name.
/search/tv Search for TV shows by title.
Timezones (Done - part of configuration)
/timezones/list Get the list of supported timezones for the API methods that support them.
TV (Done)
/tv/{id} Get the primary information about a TV series by id.
/tv/{id}/account_states This method lets users get the status of whether or not the TV show has been rated or added to their favourite or watch lists. A valid session id is required.
/tv/{id}/alternative_titles Get the alternative titles for a specific show ID.
/tv/{id}/changes Get the changes for a specific TV show id.
/tv/{id}/content_ratings Get the content ratings for a specific TV show id.
/tv/{id}/credits Get the cast & crew information about a TV series.
/tv/{id}/external_ids Get the external ids that we have stored for a TV series.
/tv/{id}/images Get the images (posters and backdrops) for a TV series.
/tv/{id}/keywords Get the plot keywords for a specific TV show id.
/tv/{id}/rating This method lets users rate a TV show. A valid session id or guest session id is required.
/tv/{id}/similar Get the similar TV shows for a specific tv id.
/tv/{id}/translations Get the list of translations that exist for a TV series. These translations cascade down to the episode level.
/tv/{id}/videos Get the videos that have been added to a TV series (trailers, opening credits, etc...)
/tv/latest Get the latest TV show id.
/tv/on_the_air Get the list of TV shows that are currently on the air. This query looks for any TV show that has an episode with an air date in the next 7 days.
/tv/airing_today Get the list of TV shows that air today. Without a specified timezone, this query defaults to EST
/tv/top_rated Get the list of top rated TV shows. By default, this list will only include TV shows that have 2 or more votes. This list refreshes every day.
/tv/popular Get the list of popular TV shows. This list refreshes every day.
TV Seasons
/tv/{id}/season/{season_number} Get the primary information about a TV season by its season number.
/tv/season/{id}/changes Look up a TV season's changes by season ID.
/tv/{id}/season/{season_number}/credits Get the cast & crew credits for a TV season by season number.
/tv/{id}/season/{season_number}/external_ids Get the external ids that we have stored for a TV season by season number.
/tv/{id}/season/{season_number}/images Get the images (posters) that we have stored for a TV season by season number.
/tv/{id}/season/{season_number}/videos Get the videos that have been added to a TV season (trailers, teasers, etc...)
TV Episodes
/tv/{id}/season/{season_number}/episode/{episode_number} Get the primary information about a TV episode by combination of a season and episode number.
/tv/episode/{id}/changes Look up a TV episode's changes by episode ID
/tv/{id}/season/{season_number}/episode/{episode_number}/account_states This method lets users get the status of whether or not the TV episode has been rated. A valid session id is required.
/tv/{id}/season/{season_number}/episode/{episode_number}/credits Get the TV episode credits by combination of season and episode number.
/tv/{id}/season/{season_number}/episode/{episode_number}/external_ids Get the external ids for a TV episode by comabination of a season and episode number.
/tv/{id}/season/{season_number}/episode/{episode_number}/images Get the images (episode stills) for a TV episode by combination of a season and episode number.
/tv/{id}/season/{season_number}/episode/{episode_number}/rating This method lets users rate a TV episode. A valid session id or guest session id is required.
/tv/{id}/season/{season_number}/episode/{episode_number}/videos Get the videos that have been added to a TV episode (teasers, clips, etc...)

@ -48,10 +48,26 @@ public final class ResultsMap<K, V> extends AbstractResults {
}
}
public boolean isEmpty() {
return results.isEmpty();
}
public Map<K, V> getResults() {
return results;
}
public boolean containsKey(K key) {
return results.containsKey(key);
}
public V get(K key) {
return results.get(key);
}
public void put(K key, V value) {
this.results.put(key, value);
}
public void setResults(Map<K, V> results) {
this.results = results;
}

@ -24,8 +24,8 @@ import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.model.config.Configuration;
import com.omertron.themoviedbapi.model.config.JobDepartment;
import com.omertron.themoviedbapi.results.ResultList;
import com.omertron.themoviedbapi.results.ResultsMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.junit.After;
import org.junit.AfterClass;
@ -119,7 +119,7 @@ public class TmdbConfigurationTest extends AbstractTests {
@Test
public void testGetTimezones() throws MovieDbException {
LOG.info("getTimezones");
Map<String, List<String>> result = instance.getTimezones();
ResultsMap<String, List<String>> result = instance.getTimezones();
assertNotNull("Null results", result);
assertFalse("Empty results", result.isEmpty());
assertTrue("No US TZ",result.containsKey("US"));

@ -24,7 +24,7 @@ import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.model.discover.Discover;
import com.omertron.themoviedbapi.model.movie.MovieBasic;
import com.omertron.themoviedbapi.model.tv.TVBasic;
import java.util.List;
import com.omertron.themoviedbapi.results.ResultList;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.assertFalse;
@ -72,7 +72,7 @@ public class TmdbDiscoverTest extends AbstractTests {
Discover discover = new Discover();
discover.year(2013).language(LANGUAGE_ENGLISH);
List<MovieBasic> result = instance.getDiscoverMovies(discover);
ResultList<MovieBasic> result = instance.getDiscoverMovies(discover);
assertFalse("No movies discovered", result.isEmpty());
}
@ -87,7 +87,7 @@ public class TmdbDiscoverTest extends AbstractTests {
Discover discover = new Discover();
discover.year(2013).language(LANGUAGE_ENGLISH);
List<TVBasic> result = instance.getDiscoverTV(discover);
ResultList<TVBasic> result = instance.getDiscoverTV(discover);
assertFalse("No TV shows discovered", result.isEmpty());
}

@ -24,7 +24,6 @@ import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.model.Genre;
import com.omertron.themoviedbapi.model.movie.MovieBasic;
import com.omertron.themoviedbapi.results.ResultList;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.assertFalse;
@ -100,7 +99,7 @@ public class TmdbGenresTest extends AbstractTests {
Integer page = null;
Boolean includeAllMovies = null;
Boolean includeAdult = null;
List<MovieBasic> result = instance.getGenreMovies(ID_GENRE_ACTION, LANGUAGE_DEFAULT, page, includeAllMovies, includeAdult);
ResultList<MovieBasic> result = instance.getGenreMovies(ID_GENRE_ACTION, LANGUAGE_DEFAULT, page, includeAllMovies, includeAdult);
assertNotNull("List is null", result);
assertFalse("List is empty", result.isEmpty());
}

@ -41,7 +41,6 @@ import com.omertron.themoviedbapi.model.media.Video;
import com.omertron.themoviedbapi.model.review.Review;
import com.omertron.themoviedbapi.results.ResultList;
import com.omertron.themoviedbapi.tools.MethodBase;
import com.omertron.themoviedbapi.wrapper.WrapperChanges;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@ -359,10 +358,10 @@ public class TmdbMoviesTest extends AbstractTests {
LOG.info("Found {} changes to check, will check maximum of {}", changeList.getResults().size(), maxCheck);
int count = 1;
WrapperChanges result;
ResultList<ChangeKeyItem> result;
for (ChangeListItem item : changeList.getResults()) {
result = instance.getMovieChanges(item.getId(), startDate, endDate);
for (ChangeKeyItem ci : result.getChangedItems()) {
for (ChangeKeyItem ci : result.getResults()) {
assertNotNull("Null changes", ci);
}

@ -37,7 +37,6 @@ import com.omertron.themoviedbapi.model.person.PersonCredits;
import com.omertron.themoviedbapi.model.person.PersonFind;
import com.omertron.themoviedbapi.results.ResultList;
import com.omertron.themoviedbapi.tools.MethodBase;
import com.omertron.themoviedbapi.wrapper.WrapperChanges;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@ -270,10 +269,10 @@ public class TmdbPeopleTest extends AbstractTests {
LOG.info("Found {} person changes to check", changeList.getResults().size());
int count = 1;
WrapperChanges result;
ResultList<ChangeKeyItem> result;
for (ChangeListItem item : changeList.getResults()) {
result = instance.getPersonChanges(item.getId(), startDate, endDate);
for (ChangeKeyItem ci : result.getChangedItems()) {
for (ChangeKeyItem ci : result.getResults()) {
assertNotNull("Null changes", ci);
}

@ -41,7 +41,6 @@ import com.omertron.themoviedbapi.model.tv.TVBasic;
import com.omertron.themoviedbapi.model.tv.TVInfo;
import com.omertron.themoviedbapi.results.ResultList;
import com.omertron.themoviedbapi.tools.MethodBase;
import com.omertron.themoviedbapi.wrapper.WrapperChanges;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@ -150,10 +149,10 @@ public class TmdbTVTest extends AbstractTests {
LOG.info("Found {} changes to check, will check maximum of {}", changeList.getResults().size(), maxCheck);
int count = 1;
WrapperChanges result;
ResultList<ChangeKeyItem> result;
for (ChangeListItem item : changeList.getResults()) {
result = instance.getTVChanges(item.getId(), startDate, endDate);
for (ChangeKeyItem ci : result.getChangedItems()) {
for (ChangeKeyItem ci : result.getResults()) {
assertNotNull("Null changes", ci);
}

Loading…
Cancel
Save