Renamed MovieDb to MovieInfo
In line with other models
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
package com.omertron.themoviedbapi;
|
||||
|
||||
import com.omertron.themoviedbapi.model.movie.MovieDb;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@ public class Compare {
|
||||
* @param year The year of the movie to compare exact match
|
||||
* @return True if there is a match, False otherwise.
|
||||
*/
|
||||
public static boolean movies(final MovieDb moviedb, final String title, final String year) {
|
||||
public static boolean movies(final MovieInfo moviedb, final String title, final String year) {
|
||||
return movies(moviedb, title, year, 0, true);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class Compare {
|
||||
* @param caseSensitive true if the comparison is to be case sensitive
|
||||
* @return True if there is a match, False otherwise.
|
||||
*/
|
||||
public static boolean movies(final MovieDb moviedb, final String title, final String year, int maxDistance, boolean caseSensitive) {
|
||||
public static boolean movies(final MovieInfo moviedb, final String title, final String year, int maxDistance, boolean caseSensitive) {
|
||||
if ((moviedb == null) || (StringUtils.isBlank(title))) {
|
||||
return false;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public class Compare {
|
||||
* @param maxDistance
|
||||
* @return
|
||||
*/
|
||||
public static boolean movies(final MovieDb moviedb, final String title, final String year, int maxDistance) {
|
||||
public static boolean movies(final MovieInfo moviedb, final String title, final String year, int maxDistance) {
|
||||
return Compare.movies(moviedb, title, year, maxDistance, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ import com.omertron.themoviedbapi.model.media.MediaCreditList;
|
||||
import com.omertron.themoviedbapi.model.media.MediaState;
|
||||
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieBasic;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieDb;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
||||
import com.omertron.themoviedbapi.model.media.Translation;
|
||||
import com.omertron.themoviedbapi.model.media.Video;
|
||||
@@ -92,7 +92,7 @@ import org.apache.http.client.HttpClient;
|
||||
import org.yamj.api.common.http.SimpleHttpClientBuilder;
|
||||
|
||||
/**
|
||||
* The MovieDb API
|
||||
* The MovieInfo API
|
||||
* <p>
|
||||
* This is for version 3 of the API as specified here:
|
||||
* http://help.themoviedb.org/kb/api/about-3
|
||||
@@ -749,7 +749,7 @@ public class TheMovieDbApi {
|
||||
* @return The list and its items
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public ListItem<MovieDb> getList(String listId) throws MovieDbException {
|
||||
public ListItem<MovieInfo> getList(String listId) throws MovieDbException {
|
||||
return tmdbList.getList(listId);
|
||||
}
|
||||
|
||||
@@ -837,7 +837,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public MovieDb getMovieInfo(int movieId, String language, String... appendToResponse) throws MovieDbException {
|
||||
public MovieInfo getMovieInfo(int movieId, String language, String... appendToResponse) throws MovieDbException {
|
||||
return tmdbMovies.getMovieInfo(movieId, language, appendToResponse);
|
||||
}
|
||||
|
||||
@@ -855,7 +855,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public MovieDb getMovieInfoImdb(String imdbId, String language, String... appendToResponse) throws MovieDbException {
|
||||
public MovieInfo getMovieInfoImdb(String imdbId, String language, String... appendToResponse) throws MovieDbException {
|
||||
return tmdbMovies.getMovieInfoImdb(imdbId, language, appendToResponse);
|
||||
}
|
||||
|
||||
@@ -988,7 +988,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getSimilarMovies(int movieId, Integer page, String language, String... appendToResponse) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getSimilarMovies(int movieId, Integer page, String language, String... appendToResponse) throws MovieDbException {
|
||||
return tmdbMovies.getSimilarMovies(movieId, page, language, appendToResponse);
|
||||
}
|
||||
|
||||
@@ -1064,7 +1064,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public MovieDb getLatestMovie() throws MovieDbException {
|
||||
public MovieInfo getLatestMovie() throws MovieDbException {
|
||||
return tmdbMovies.getLatestMovie();
|
||||
}
|
||||
|
||||
@@ -1080,7 +1080,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getUpcoming(Integer page, String language) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getUpcoming(Integer page, String language) throws MovieDbException {
|
||||
return tmdbMovies.getUpcoming(page, language);
|
||||
}
|
||||
|
||||
@@ -1095,7 +1095,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getNowPlayingMovies(Integer page, String language) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getNowPlayingMovies(Integer page, String language) throws MovieDbException {
|
||||
return tmdbMovies.getNowPlayingMovies(page, language);
|
||||
}
|
||||
|
||||
@@ -1109,7 +1109,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getPopularMovieList(Integer page, String language) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getPopularMovieList(Integer page, String language) throws MovieDbException {
|
||||
return tmdbMovies.getPopularMovieList(page, language);
|
||||
}
|
||||
|
||||
@@ -1124,7 +1124,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getTopRatedMovies(Integer page, String language) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getTopRatedMovies(Integer page, String language) throws MovieDbException {
|
||||
return tmdbMovies.getTopRatedMovies(page, language);
|
||||
}
|
||||
//</editor-fold>
|
||||
@@ -1375,7 +1375,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> searchMovie(String query,
|
||||
public TmdbResultsList<MovieInfo> searchMovie(String query,
|
||||
Integer page,
|
||||
String language,
|
||||
Boolean includeAdult,
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.omertron.themoviedbapi.model.keyword.Keyword;
|
||||
import com.omertron.themoviedbapi.model.list.UserList;
|
||||
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieBasic;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieDb;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.model.person.ContentRating;
|
||||
import com.omertron.themoviedbapi.model.person.Person;
|
||||
import com.omertron.themoviedbapi.model.person.PersonFind;
|
||||
@@ -74,7 +74,7 @@ public class AbstractMethod {
|
||||
});
|
||||
TYPE_REFS.put(Keyword.class, new TypeReference<WrapperGenericList<Keyword>>() {
|
||||
});
|
||||
TYPE_REFS.put(MovieDb.class, new TypeReference<WrapperGenericList<MovieDb>>() {
|
||||
TYPE_REFS.put(MovieInfo.class, new TypeReference<WrapperGenericList<MovieInfo>>() {
|
||||
});
|
||||
TYPE_REFS.put(Person.class, new TypeReference<WrapperGenericList<Person>>() {
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.omertron.themoviedbapi.model.list.ListStatusCode;
|
||||
import com.omertron.themoviedbapi.model.StatusCode;
|
||||
import com.omertron.themoviedbapi.model.list.ListItem;
|
||||
import com.omertron.themoviedbapi.model.list.ListItemStatus;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieDb;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.tools.ApiUrl;
|
||||
import com.omertron.themoviedbapi.tools.HttpTools;
|
||||
import com.omertron.themoviedbapi.tools.MethodBase;
|
||||
@@ -63,7 +63,7 @@ public class TmdbLists extends AbstractMethod {
|
||||
* @return The list and its items
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public ListItem<MovieDb> getList(String listId) throws MovieDbException {
|
||||
public ListItem<MovieInfo> getList(String listId) throws MovieDbException {
|
||||
TmdbParameters parameters = new TmdbParameters();
|
||||
parameters.add(Param.ID, listId);
|
||||
|
||||
@@ -71,7 +71,7 @@ public class TmdbLists extends AbstractMethod {
|
||||
String webpage = httpTools.getRequest(url);
|
||||
|
||||
try {
|
||||
return MAPPER.readValue(webpage, new TypeReference<ListItem<MovieDb>>() {
|
||||
return MAPPER.readValue(webpage, new TypeReference<ListItem<MovieInfo>>() {
|
||||
});
|
||||
} catch (IOException ex) {
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get list", url, ex);
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.omertron.themoviedbapi.model.list.UserList;
|
||||
import com.omertron.themoviedbapi.model.media.MediaCreditList;
|
||||
import com.omertron.themoviedbapi.model.media.MediaState;
|
||||
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieDb;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
||||
import com.omertron.themoviedbapi.model.media.Translation;
|
||||
import com.omertron.themoviedbapi.model.media.Video;
|
||||
@@ -87,7 +87,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public MovieDb getMovieInfo(int movieId, String language, String... appendToResponse) throws MovieDbException {
|
||||
public MovieInfo getMovieInfo(int movieId, String language, String... appendToResponse) throws MovieDbException {
|
||||
TmdbParameters parameters = new TmdbParameters();
|
||||
parameters.add(Param.ID, movieId);
|
||||
parameters.add(Param.LANGUAGE, language);
|
||||
@@ -96,7 +96,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).buildUrl(parameters);
|
||||
String webpage = httpTools.getRequest(url);
|
||||
try {
|
||||
MovieDb movie = MAPPER.readValue(webpage, MovieDb.class);
|
||||
MovieInfo movie = MAPPER.readValue(webpage, MovieInfo.class);
|
||||
if (movie == null || movie.getId() == 0) {
|
||||
throw new MovieDbException(ApiExceptionType.ID_NOT_FOUND, "No movie found for ID: " + movieId, url);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public MovieDb getMovieInfoImdb(String imdbId, String language, String... appendToResponse) throws MovieDbException {
|
||||
public MovieInfo getMovieInfoImdb(String imdbId, String language, String... appendToResponse) throws MovieDbException {
|
||||
TmdbParameters parameters = new TmdbParameters();
|
||||
parameters.add(Param.ID, imdbId);
|
||||
parameters.add(Param.LANGUAGE, language);
|
||||
@@ -130,7 +130,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
String webpage = httpTools.getRequest(url);
|
||||
|
||||
try {
|
||||
MovieDb movie = MAPPER.readValue(webpage, MovieDb.class);
|
||||
MovieInfo movie = MAPPER.readValue(webpage, MovieInfo.class);
|
||||
if (movie == null || movie.getId() == 0) {
|
||||
throw new MovieDbException(ApiExceptionType.ID_NOT_FOUND, "No movie found for IMDB ID: " + imdbId, url);
|
||||
}
|
||||
@@ -377,7 +377,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getSimilarMovies(int movieId, Integer page, String language, String... appendToResponse) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getSimilarMovies(int movieId, Integer page, String language, String... appendToResponse) throws MovieDbException {
|
||||
TmdbParameters parameters = new TmdbParameters();
|
||||
parameters.add(Param.ID, movieId);
|
||||
parameters.add(Param.LANGUAGE, language);
|
||||
@@ -385,7 +385,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
parameters.add(Param.APPEND, appendToResponse);
|
||||
|
||||
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.SIMILAR).buildUrl(parameters);
|
||||
WrapperGenericList<MovieDb> wrapper = processWrapper(getTypeReference(MovieDb.class), url, "similar movies");
|
||||
WrapperGenericList<MovieInfo> wrapper = processWrapper(getTypeReference(MovieInfo.class), url, "similar movies");
|
||||
return wrapper.getTmdbResultsList();
|
||||
}
|
||||
|
||||
@@ -509,12 +509,12 @@ public class TmdbMovies extends AbstractMethod {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public MovieDb getLatestMovie() throws MovieDbException {
|
||||
public MovieInfo getLatestMovie() throws MovieDbException {
|
||||
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.LATEST).buildUrl();
|
||||
String webpage = httpTools.getRequest(url);
|
||||
|
||||
try {
|
||||
return MAPPER.readValue(webpage, MovieDb.class);
|
||||
return MAPPER.readValue(webpage, MovieInfo.class);
|
||||
} catch (IOException ex) {
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get latest movie", url, ex);
|
||||
}
|
||||
@@ -532,13 +532,13 @@ public class TmdbMovies extends AbstractMethod {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getUpcoming(Integer page, String language) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getUpcoming(Integer page, String language) throws MovieDbException {
|
||||
TmdbParameters parameters = new TmdbParameters();
|
||||
parameters.add(Param.LANGUAGE, language);
|
||||
parameters.add(Param.PAGE, page);
|
||||
|
||||
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.UPCOMING).buildUrl(parameters);
|
||||
WrapperGenericList<MovieDb> wrapper = processWrapper(getTypeReference(MovieDb.class), url, "upcoming movies");
|
||||
WrapperGenericList<MovieInfo> wrapper = processWrapper(getTypeReference(MovieInfo.class), url, "upcoming movies");
|
||||
return wrapper.getTmdbResultsList();
|
||||
}
|
||||
|
||||
@@ -553,13 +553,13 @@ public class TmdbMovies extends AbstractMethod {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getNowPlayingMovies(Integer page, String language) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getNowPlayingMovies(Integer page, String language) throws MovieDbException {
|
||||
TmdbParameters parameters = new TmdbParameters();
|
||||
parameters.add(Param.LANGUAGE, language);
|
||||
parameters.add(Param.PAGE, page);
|
||||
|
||||
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.NOW_PLAYING).buildUrl(parameters);
|
||||
WrapperGenericList<MovieDb> wrapper = processWrapper(getTypeReference(MovieDb.class), url, "now playing movies");
|
||||
WrapperGenericList<MovieInfo> wrapper = processWrapper(getTypeReference(MovieInfo.class), url, "now playing movies");
|
||||
return wrapper.getTmdbResultsList();
|
||||
}
|
||||
|
||||
@@ -573,13 +573,13 @@ public class TmdbMovies extends AbstractMethod {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getPopularMovieList(Integer page, String language) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getPopularMovieList(Integer page, String language) throws MovieDbException {
|
||||
TmdbParameters parameters = new TmdbParameters();
|
||||
parameters.add(Param.LANGUAGE, language);
|
||||
parameters.add(Param.PAGE, page);
|
||||
|
||||
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.POPULAR).buildUrl(parameters);
|
||||
WrapperGenericList<MovieDb> wrapper = processWrapper(getTypeReference(MovieDb.class), url, "popular movie list");
|
||||
WrapperGenericList<MovieInfo> wrapper = processWrapper(getTypeReference(MovieInfo.class), url, "popular movie list");
|
||||
return wrapper.getTmdbResultsList();
|
||||
}
|
||||
|
||||
@@ -594,13 +594,13 @@ public class TmdbMovies extends AbstractMethod {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> getTopRatedMovies(Integer page, String language) throws MovieDbException {
|
||||
public TmdbResultsList<MovieInfo> getTopRatedMovies(Integer page, String language) throws MovieDbException {
|
||||
TmdbParameters parameters = new TmdbParameters();
|
||||
parameters.add(Param.LANGUAGE, language);
|
||||
parameters.add(Param.PAGE, page);
|
||||
|
||||
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.TOP_RATED).buildUrl(parameters);
|
||||
WrapperGenericList<MovieDb> wrapper = processWrapper(getTypeReference(MovieDb.class), url, "top rated movies");
|
||||
WrapperGenericList<MovieInfo> wrapper = processWrapper(getTypeReference(MovieInfo.class), url, "top rated movies");
|
||||
return wrapper.getTmdbResultsList();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.omertron.themoviedbapi.model.company.Company;
|
||||
import com.omertron.themoviedbapi.model.keyword.Keyword;
|
||||
import com.omertron.themoviedbapi.model.list.UserList;
|
||||
import com.omertron.themoviedbapi.model.media.MediaBasic;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieDb;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.model.person.PersonFind;
|
||||
import com.omertron.themoviedbapi.model.tv.TVBasic;
|
||||
import com.omertron.themoviedbapi.results.TmdbResultsList;
|
||||
@@ -154,7 +154,7 @@ public class TmdbSearch extends AbstractMethod {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public TmdbResultsList<MovieDb> searchMovie(String query,
|
||||
public TmdbResultsList<MovieInfo> searchMovie(String query,
|
||||
Integer page,
|
||||
String language,
|
||||
Boolean includeAdult,
|
||||
@@ -173,7 +173,7 @@ public class TmdbSearch extends AbstractMethod {
|
||||
}
|
||||
URL url = new ApiUrl(apiKey, MethodBase.SEARCH).subMethod(MethodSub.MOVIE).buildUrl(parameters);
|
||||
|
||||
WrapperGenericList<MovieDb> wrapper = processWrapper(getTypeReference(MovieDb.class), url, "movie");
|
||||
WrapperGenericList<MovieInfo> wrapper = processWrapper(getTypeReference(MovieInfo.class), url, "movie");
|
||||
return wrapper.getTmdbResultsList();
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -51,7 +51,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
*
|
||||
* @author stuart.boston
|
||||
*/
|
||||
public class MovieDb extends AbstractJsonMapping {
|
||||
public class MovieInfo extends AbstractJsonMapping {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@JsonProperty("backdrop_path")
|
||||
@@ -119,7 +119,7 @@ public class MovieDb extends AbstractJsonMapping {
|
||||
private WrapperVideos trailers;
|
||||
@JsonProperty("translations")
|
||||
private WrapperTranslations translations;
|
||||
private List<MovieDb> similarMovies;
|
||||
private List<MovieInfo> similarMovies;
|
||||
private List<Review> reviews;
|
||||
private List<UserList> lists;
|
||||
@JsonProperty("video")
|
||||
@@ -370,7 +370,7 @@ public class MovieDb extends AbstractJsonMapping {
|
||||
return translations.getTranslations();
|
||||
}
|
||||
|
||||
public List<MovieDb> getSimilarMovies() {
|
||||
public List<MovieInfo> getSimilarMovies() {
|
||||
return similarMovies;
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ public class MovieDb extends AbstractJsonMapping {
|
||||
}
|
||||
|
||||
@JsonSetter("similar_movies")
|
||||
public void setSimilarMovies(WrapperGenericList<MovieDb> similarMovies) {
|
||||
public void setSimilarMovies(WrapperGenericList<MovieInfo> similarMovies) {
|
||||
this.similarMovies = similarMovies.getResults();
|
||||
}
|
||||
|
||||
@@ -431,8 +431,8 @@ public class MovieDb extends AbstractJsonMapping {
|
||||
//<editor-fold defaultstate="collapsed" desc="Equals and HashCode">
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof MovieDb) {
|
||||
final MovieDb other = (MovieDb) obj;
|
||||
if (obj instanceof MovieInfo) {
|
||||
final MovieInfo other = (MovieInfo) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(id, other.id)
|
||||
.append(imdbID, other.imdbID)
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
package com.omertron.themoviedbapi;
|
||||
|
||||
import com.omertron.themoviedbapi.model.movie.MovieDb;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
@@ -24,7 +24,7 @@ public class CompareTest {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CompareTest.class);
|
||||
|
||||
private static MovieDb moviedb;
|
||||
private static MovieInfo moviedb;
|
||||
private static final String TITLE_MAIN = "Blade Runner";
|
||||
private static final String TITLE_OTHER = "Blade Runner Directors Cut";
|
||||
private static final String YEAR_FULL = "1982-01-01";
|
||||
@@ -41,7 +41,7 @@ public class CompareTest {
|
||||
TestLogger.Configure();
|
||||
|
||||
// Set the default comparison movie
|
||||
moviedb = new MovieDb();
|
||||
moviedb = new MovieInfo();
|
||||
moviedb.setTitle(TITLE_MAIN);
|
||||
moviedb.setOriginalTitle(TITLE_OTHER);
|
||||
moviedb.setReleaseDate(YEAR_FULL);
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.omertron.themoviedbapi.model.media.MediaCreditCast;
|
||||
import com.omertron.themoviedbapi.model.media.MediaCreditList;
|
||||
import com.omertron.themoviedbapi.model.media.MediaState;
|
||||
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieDb;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
||||
import com.omertron.themoviedbapi.model.media.Translation;
|
||||
import com.omertron.themoviedbapi.model.media.Video;
|
||||
@@ -94,7 +94,7 @@ public class TmdbMoviesTest extends AbstractTests {
|
||||
String[] appendToResponse = null;
|
||||
|
||||
for (TestID test : FILM_IDS) {
|
||||
MovieDb result = instance.getMovieInfo(test.getTmdb(), language, appendToResponse);
|
||||
MovieInfo result = instance.getMovieInfo(test.getTmdb(), language, appendToResponse);
|
||||
assertEquals("Wrong IMDB ID", test.getImdb(), result.getImdbID());
|
||||
assertEquals("Wrong title", test.getName(), result.getTitle());
|
||||
|
||||
@@ -113,7 +113,7 @@ public class TmdbMoviesTest extends AbstractTests {
|
||||
String[] appendToResponse = null;
|
||||
|
||||
for (TestID test : FILM_IDS) {
|
||||
MovieDb result = instance.getMovieInfoImdb(test.getImdb(), language, appendToResponse);
|
||||
MovieInfo result = instance.getMovieInfoImdb(test.getImdb(), language, appendToResponse);
|
||||
assertEquals("Wrong TMDB ID", test.getTmdb(), result.getId());
|
||||
assertEquals("Wrong title", test.getName(), result.getTitle());
|
||||
}
|
||||
@@ -295,7 +295,7 @@ public class TmdbMoviesTest extends AbstractTests {
|
||||
String[] appendToResponse = null;
|
||||
|
||||
for (TestID test : FILM_IDS) {
|
||||
TmdbResultsList<MovieDb> result = instance.getSimilarMovies(test.getTmdb(), page, language, appendToResponse);
|
||||
TmdbResultsList<MovieInfo> result = instance.getSimilarMovies(test.getTmdb(), page, language, appendToResponse);
|
||||
assertFalse("No similar movies", result.isEmpty());
|
||||
}
|
||||
}
|
||||
@@ -399,7 +399,7 @@ public class TmdbMoviesTest extends AbstractTests {
|
||||
public void testGetLatestMovie() throws MovieDbException {
|
||||
LOG.info("getLatestMovie");
|
||||
|
||||
MovieDb result = instance.getLatestMovie();
|
||||
MovieInfo result = instance.getLatestMovie();
|
||||
assertNotNull("Null movie returned", result);
|
||||
assertTrue("No ID", result.getId() > 0);
|
||||
assertTrue("No title", StringUtils.isNotBlank(result.getTitle()));
|
||||
@@ -416,7 +416,7 @@ public class TmdbMoviesTest extends AbstractTests {
|
||||
Integer page = null;
|
||||
String language = LANGUAGE_DEFAULT;
|
||||
|
||||
TmdbResultsList<MovieDb> result = instance.getUpcoming(page, language);
|
||||
TmdbResultsList<MovieInfo> result = instance.getUpcoming(page, language);
|
||||
assertFalse("No results found", result.isEmpty());
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ public class TmdbMoviesTest extends AbstractTests {
|
||||
Integer page = null;
|
||||
String language = LANGUAGE_DEFAULT;
|
||||
|
||||
TmdbResultsList<MovieDb> result = instance.getNowPlayingMovies(page, language);
|
||||
TmdbResultsList<MovieInfo> result = instance.getNowPlayingMovies(page, language);
|
||||
assertFalse("No results found", result.isEmpty());
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ public class TmdbMoviesTest extends AbstractTests {
|
||||
Integer page = null;
|
||||
String language = LANGUAGE_DEFAULT;
|
||||
|
||||
TmdbResultsList<MovieDb> result = instance.getPopularMovieList(page, language);
|
||||
TmdbResultsList<MovieInfo> result = instance.getPopularMovieList(page, language);
|
||||
assertFalse("No results found", result.isEmpty());
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ public class TmdbMoviesTest extends AbstractTests {
|
||||
Integer page = null;
|
||||
String language = LANGUAGE_DEFAULT;
|
||||
|
||||
TmdbResultsList<MovieDb> result = instance.getTopRatedMovies(page, language);
|
||||
TmdbResultsList<MovieInfo> result = instance.getTopRatedMovies(page, language);
|
||||
assertFalse("No results found", result.isEmpty());
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.omertron.themoviedbapi.model.company.Company;
|
||||
import com.omertron.themoviedbapi.model.keyword.Keyword;
|
||||
import com.omertron.themoviedbapi.model.list.UserList;
|
||||
import com.omertron.themoviedbapi.model.media.MediaBasic;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieDb;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.model.person.PersonFind;
|
||||
import com.omertron.themoviedbapi.model.tv.TVBasic;
|
||||
import com.omertron.themoviedbapi.results.TmdbResultsList;
|
||||
@@ -142,7 +142,7 @@ public class TmdbSearchTest extends AbstractTests {
|
||||
LOG.info("searchMovie");
|
||||
|
||||
// Try a movie with less than 1 page of results
|
||||
TmdbResultsList<MovieDb> movieList = instance.searchMovie("Blade Runner", 0, "", null, 0, 0, SearchType.PHRASE);
|
||||
TmdbResultsList<MovieInfo> movieList = instance.searchMovie("Blade Runner", 0, "", null, 0, 0, SearchType.PHRASE);
|
||||
assertTrue("No movies found, should be at least 1", movieList.getResults().size() > 0);
|
||||
|
||||
// Try a russian langugage movie
|
||||
|
||||
Reference in New Issue
Block a user