Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f1c359a9f | |||
| 0c455accb5 | |||
| ca4fc59a80 | |||
| 799d6d6fd5 | |||
| 39465e1ba2 | |||
| c208b62384 | |||
| e83d947dfe | |||
| bab9c80781 | |||
| 45515869c6 | |||
| 11f18ce3d8 | |||
| a9e22f4d75 | |||
| 1d977f9d7b | |||
| 96aa13bd70 | |||
| 84e08a93e2 | |||
| 2dc61738c8 | |||
| b0c998b984 |
+2
-1
@@ -11,4 +11,5 @@ testing.properties
|
|||||||
.settings
|
.settings
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
/nbproject/
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<groupId>com.omertron</groupId>
|
<groupId>com.omertron</groupId>
|
||||||
<artifactId>themoviedbapi</artifactId>
|
<artifactId>themoviedbapi</artifactId>
|
||||||
<version>4.2</version>
|
<version>4.3</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>API-The MovieDB</name>
|
<name>API-The MovieDB</name>
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
|
*
|
||||||
|
* This file is part of TheMovieDB API.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.omertron.themoviedbapi.enumeration;
|
||||||
|
|
||||||
|
public enum Gender {
|
||||||
|
MALE(1),
|
||||||
|
FEMALE(2),
|
||||||
|
UNKNOWN(0);
|
||||||
|
|
||||||
|
private final int type;
|
||||||
|
|
||||||
|
private Gender(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the gender from an integer type
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Gender fromInteger(int type) {
|
||||||
|
for (Gender gender : Gender.values()) {
|
||||||
|
if (gender.type == type) {
|
||||||
|
return gender;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
|
*
|
||||||
|
* This file is part of TheMovieDB API.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.omertron.themoviedbapi.enumeration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release Type for the video
|
||||||
|
*
|
||||||
|
* @author stuar
|
||||||
|
*/
|
||||||
|
public enum ReleaseType {
|
||||||
|
PREMIERE(1),
|
||||||
|
THEATRICAL_LIMITED(2),
|
||||||
|
THEATRICAL(3),
|
||||||
|
DIGITAL(4),
|
||||||
|
PHYSICAL(5),
|
||||||
|
TV(6),
|
||||||
|
UNKNOWN(0);
|
||||||
|
|
||||||
|
private final int type;
|
||||||
|
|
||||||
|
private ReleaseType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Release Type from an integer type
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static ReleaseType fromInteger(int type) {
|
||||||
|
for (ReleaseType rt : ReleaseType.values()) {
|
||||||
|
if (rt.type == type) {
|
||||||
|
return rt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -32,6 +32,7 @@ import com.omertron.themoviedbapi.model.list.UserList;
|
|||||||
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
||||||
import com.omertron.themoviedbapi.model.movie.MovieBasic;
|
import com.omertron.themoviedbapi.model.movie.MovieBasic;
|
||||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||||
|
import com.omertron.themoviedbapi.model.movie.ReleaseDates;
|
||||||
import com.omertron.themoviedbapi.model.person.ContentRating;
|
import com.omertron.themoviedbapi.model.person.ContentRating;
|
||||||
import com.omertron.themoviedbapi.model.person.PersonInfo;
|
import com.omertron.themoviedbapi.model.person.PersonInfo;
|
||||||
import com.omertron.themoviedbapi.model.person.PersonFind;
|
import com.omertron.themoviedbapi.model.person.PersonFind;
|
||||||
@@ -100,6 +101,8 @@ public class AbstractMethod {
|
|||||||
});
|
});
|
||||||
TYPE_REFS.put(AlternativeTitle.class, new TypeReference<WrapperGenericList<AlternativeTitle>>() {
|
TYPE_REFS.put(AlternativeTitle.class, new TypeReference<WrapperGenericList<AlternativeTitle>>() {
|
||||||
});
|
});
|
||||||
|
TYPE_REFS.put(ReleaseDates.class, new TypeReference<WrapperGenericList<ReleaseDates>>() {
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import com.omertron.themoviedbapi.model.media.MediaState;
|
|||||||
import com.omertron.themoviedbapi.model.media.Translation;
|
import com.omertron.themoviedbapi.model.media.Translation;
|
||||||
import com.omertron.themoviedbapi.model.media.Video;
|
import com.omertron.themoviedbapi.model.media.Video;
|
||||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||||
|
import com.omertron.themoviedbapi.model.movie.ReleaseDates;
|
||||||
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
||||||
import com.omertron.themoviedbapi.model.review.Review;
|
import com.omertron.themoviedbapi.model.review.Review;
|
||||||
import com.omertron.themoviedbapi.results.ResultList;
|
import com.omertron.themoviedbapi.results.ResultList;
|
||||||
@@ -78,8 +79,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
*
|
*
|
||||||
* It will return the single highest rated poster and backdrop.
|
* It will return the single highest rated poster and backdrop.
|
||||||
*
|
*
|
||||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
|
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
|
||||||
* found.
|
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @param language
|
* @param language
|
||||||
@@ -111,8 +111,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
*
|
*
|
||||||
* It will return the single highest rated poster and backdrop.
|
* It will return the single highest rated poster and backdrop.
|
||||||
*
|
*
|
||||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
|
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
|
||||||
* found.
|
|
||||||
*
|
*
|
||||||
* @param imdbId
|
* @param imdbId
|
||||||
* @param language
|
* @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
|
* 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
|
||||||
* been rated or added to their favourite or movie watch list.
|
* list.
|
||||||
*
|
*
|
||||||
* A valid session id is required.
|
* 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
|
* This method is used to retrieve all of the alternative titles we have for a particular movie.
|
||||||
* a particular movie.
|
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @param country
|
* @param country
|
||||||
@@ -213,8 +211,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should be used when you’re wanting to retrieve all of the
|
* This method should be used when you’re wanting to retrieve all of the images for a particular movie.
|
||||||
* images for a particular movie.
|
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @param language
|
* @param language
|
||||||
@@ -240,8 +237,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve all of the keywords that have been added
|
* This method is used to retrieve all of the keywords that have been added to a particular movie.
|
||||||
* to a particular movie.
|
|
||||||
*
|
*
|
||||||
* Currently, only English keywords exist.
|
* Currently, only English keywords exist.
|
||||||
*
|
*
|
||||||
@@ -267,8 +263,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve all of the release and certification data
|
* This method is used to retrieve all of the release and certification data we have for a specific movie.
|
||||||
* we have for a specific movie.
|
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @param language
|
* @param language
|
||||||
@@ -294,8 +289,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve all of the trailers for a particular
|
* This method is used to retrieve all of the trailers for a particular movie.
|
||||||
* movie.
|
|
||||||
*
|
*
|
||||||
* Supported sites are YouTube and QuickTime.
|
* Supported sites are YouTube and QuickTime.
|
||||||
*
|
*
|
||||||
@@ -323,8 +317,25 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve a list of the available translations for
|
* Get the release dates, certifications and related information by country for a specific movie id.
|
||||||
* a specific movie.
|
*
|
||||||
|
* The results are keyed by country code and contain a type value.
|
||||||
|
*
|
||||||
|
* @param movieId
|
||||||
|
* @return
|
||||||
|
* @throws MovieDbException
|
||||||
|
*/
|
||||||
|
public ResultList<ReleaseDates> getReleaseDates(int movieId) throws MovieDbException {
|
||||||
|
TmdbParameters parameters = new TmdbParameters();
|
||||||
|
parameters.add(Param.ID, movieId);
|
||||||
|
|
||||||
|
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.RELEASE_DATES).buildUrl(parameters);
|
||||||
|
WrapperGenericList<ReleaseDates> wrapper = processWrapper(getTypeReference(ReleaseDates.class), url, "release dates");
|
||||||
|
return wrapper.getResultsList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is used to retrieve a list of the available translations for a specific movie.
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @return
|
* @return
|
||||||
@@ -348,11 +359,9 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The similar movies method will let you retrieve the similar movies for a
|
* The similar movies method will let you retrieve the similar movies for a particular movie.
|
||||||
* particular movie.
|
|
||||||
*
|
*
|
||||||
* This data is created dynamically but with the help of users votes on
|
* This data is created dynamically but with the help of users votes on TMDb.
|
||||||
* TMDb.
|
|
||||||
*
|
*
|
||||||
* The data is much better with movies that have more keywords
|
* The data is much better with movies that have more keywords
|
||||||
*
|
*
|
||||||
@@ -420,8 +429,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
*
|
*
|
||||||
* By default, only the last 24 hours of changes are returned.
|
* 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
|
* The maximum number of days that can be returned in a single request is 14.
|
||||||
* 14.
|
|
||||||
*
|
*
|
||||||
* The language is present on fields that are translatable.
|
* The language is present on fields that are translatable.
|
||||||
*
|
*
|
||||||
@@ -513,8 +521,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
/**
|
/**
|
||||||
* This method is used to retrieve the movies currently in theatres.
|
* This method is used to retrieve the movies currently in theatres.
|
||||||
*
|
*
|
||||||
* This is a curated list that will normally contain 100 movies. The default
|
* This is a curated list that will normally contain 100 movies. The default response will return 20 movies.
|
||||||
* response will return 20 movies.
|
|
||||||
*
|
*
|
||||||
* @param language
|
* @param language
|
||||||
* @param page
|
* @param page
|
||||||
@@ -552,8 +559,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve the top rated movies that have over 10
|
* This method is used to retrieve the top rated movies that have over 10 votes on TMDb.
|
||||||
* votes on TMDb.
|
|
||||||
*
|
*
|
||||||
* The default response will return 20 movies.
|
* The default response will return 20 movies.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ public abstract class AbstractJsonMapping implements Serializable {
|
|||||||
@JsonAnySetter
|
@JsonAnySetter
|
||||||
protected void handleUnknown(String key, Object value) {
|
protected void handleUnknown(String key, Object value) {
|
||||||
StringBuilder unknown = new StringBuilder(this.getClass().getSimpleName());
|
StringBuilder unknown = new StringBuilder(this.getClass().getSimpleName());
|
||||||
unknown.append(": Unknown property='").append(key);
|
unknown.append(": Unknown property='").append(key)
|
||||||
unknown.append("' value='").append(value).append("'");
|
.append("' value='").append(value).append("'");
|
||||||
|
|
||||||
LOG.trace(unknown.toString());
|
LOG.trace(unknown.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,20 +34,20 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
|||||||
private static final long serialVersionUID = 100L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("iso_639_1")
|
@JsonProperty("iso_639_1")
|
||||||
private String isoCode;
|
private String code;
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
public String getIsoCode() {
|
public String getCode() {
|
||||||
return isoCode;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsoCode(String isoCode) {
|
public void setCode(String code) {
|
||||||
this.isoCode = isoCode;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
@@ -59,7 +59,7 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
|||||||
if (obj instanceof Language) {
|
if (obj instanceof Language) {
|
||||||
final Language other = (Language) obj;
|
final Language other = (Language) obj;
|
||||||
return new EqualsBuilder()
|
return new EqualsBuilder()
|
||||||
.append(isoCode, other.isoCode)
|
.append(code, other.code)
|
||||||
.append(name, other.name)
|
.append(name, other.name)
|
||||||
.isEquals();
|
.isEquals();
|
||||||
} else {
|
} else {
|
||||||
@@ -70,7 +70,7 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return new HashCodeBuilder()
|
return new HashCodeBuilder()
|
||||||
.append(isoCode)
|
.append(code)
|
||||||
.append(name)
|
.append(name)
|
||||||
.toHashCode();
|
.toHashCode();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,8 +199,7 @@ public class Configuration extends AbstractJsonMapping implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(getBaseUrl());
|
StringBuilder sb = new StringBuilder(getBaseUrl());
|
||||||
sb.append(requiredSize);
|
sb.append(requiredSize).append(imagePath);
|
||||||
sb.append(imagePath);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new URL(sb.toString());
|
return new URL(sb.toString());
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import com.omertron.themoviedbapi.tools.TmdbParameters;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a discover object for use in the MovieDbApi
|
* Generate a discover object for use in the MovieDbApi
|
||||||
* <p/>
|
* <p>
|
||||||
* This allows you to just add the search components you are concerned with
|
* This allows you to just add the search components you are concerned with
|
||||||
*
|
*
|
||||||
* @author stuart.boston
|
* @author stuart.boston
|
||||||
@@ -39,7 +39,7 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the parameters
|
* Get the parameters
|
||||||
* <p/>
|
* <p>
|
||||||
* This will be used to construct the URL in the API
|
* This will be used to construct the URL in the API
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@@ -183,7 +183,7 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The minimum release to include.
|
* The minimum release to include.
|
||||||
* <p/>
|
* <p>
|
||||||
* Expected format is YYYY-MM-DD.
|
* Expected format is YYYY-MM-DD.
|
||||||
*
|
*
|
||||||
* @param releaseDateGte
|
* @param releaseDateGte
|
||||||
@@ -196,7 +196,7 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum release to include.
|
* The maximum release to include.
|
||||||
* <p/>
|
* <p>
|
||||||
* Expected format is YYYY-MM-DD.
|
* Expected format is YYYY-MM-DD.
|
||||||
*
|
*
|
||||||
* @param releaseDateLte
|
* @param releaseDateLte
|
||||||
@@ -209,9 +209,9 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Only include movies with certifications for a specific country.
|
* Only include movies with certifications for a specific country.
|
||||||
* <p/>
|
* <p>
|
||||||
* When this value is specified, 'certificationLte' is required.
|
* When this value is specified, 'certificationLte' is required.
|
||||||
* <p/>
|
* <p>
|
||||||
* A ISO 3166-1 is expected
|
* A ISO 3166-1 is expected
|
||||||
*
|
*
|
||||||
* @param certificationCountry
|
* @param certificationCountry
|
||||||
@@ -224,7 +224,7 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Only include movies with this certification and lower.
|
* Only include movies with this certification and lower.
|
||||||
* <p/>
|
* <p>
|
||||||
* Expected value is a valid certification for the specified 'certificationCountry'.
|
* Expected value is a valid certification for the specified 'certificationCountry'.
|
||||||
*
|
*
|
||||||
* @param certificationLte
|
* @param certificationLte
|
||||||
@@ -337,11 +337,11 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Only include movies with the specified genres.
|
* Only include movies with the specified genres.
|
||||||
* <p/>
|
* <p>
|
||||||
* Expected value is an integer (the id of a genre).
|
* Expected value is an integer (the id of a genre).
|
||||||
* <p/>
|
* <p>
|
||||||
* Multiple values can be specified.
|
* Multiple values can be specified.
|
||||||
* <p/>
|
* <p>
|
||||||
* Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'
|
* Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'
|
||||||
*
|
*
|
||||||
* @param withGenres
|
* @param withGenres
|
||||||
|
|||||||
@@ -37,34 +37,44 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
|||||||
@JsonProperty("english_name")
|
@JsonProperty("english_name")
|
||||||
private String englishName;
|
private String englishName;
|
||||||
@JsonProperty("iso_639_1")
|
@JsonProperty("iso_639_1")
|
||||||
private String isoCode;
|
private String language;
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
@JsonProperty("iso_3166_1")
|
||||||
|
private String country;
|
||||||
|
|
||||||
public String getEnglishName() {
|
public String getEnglishName() {
|
||||||
return englishName;
|
return englishName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsoCode() {
|
public String getLanguage() {
|
||||||
return isoCode;
|
return language;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
public void setEnglishName(String englishName) {
|
public void setEnglishName(String englishName) {
|
||||||
this.englishName = englishName;
|
this.englishName = englishName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsoCode(String isoCode) {
|
public void setLanguage(String language) {
|
||||||
this.isoCode = isoCode;
|
this.language = language;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof Translation) {
|
if (obj instanceof Translation) {
|
||||||
@@ -72,7 +82,7 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
|||||||
return new EqualsBuilder()
|
return new EqualsBuilder()
|
||||||
.append(name, other.name)
|
.append(name, other.name)
|
||||||
.append(englishName, other.englishName)
|
.append(englishName, other.englishName)
|
||||||
.append(isoCode, other.isoCode)
|
.append(language, other.language)
|
||||||
.isEquals();
|
.isEquals();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -83,7 +93,7 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return new HashCodeBuilder()
|
return new HashCodeBuilder()
|
||||||
.append(englishName)
|
.append(englishName)
|
||||||
.append(isoCode)
|
.append(language)
|
||||||
.append(name)
|
.append(name)
|
||||||
.toHashCode();
|
.toHashCode();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private String id;
|
private String id;
|
||||||
@JsonProperty("iso_639_1")
|
|
||||||
private String language;
|
|
||||||
@JsonProperty("key")
|
@JsonProperty("key")
|
||||||
private String key;
|
private String key;
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
@@ -48,6 +46,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
private int size;
|
private int size;
|
||||||
@JsonProperty("type")
|
@JsonProperty("type")
|
||||||
private String type;
|
private String type;
|
||||||
|
@JsonProperty("iso_639_1")
|
||||||
|
private String language;
|
||||||
|
@JsonProperty("iso_3166_1")
|
||||||
|
private String country;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
@@ -77,6 +79,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
return language;
|
return language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
@@ -105,6 +111,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
this.language = language;
|
this.language = language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof Video) {
|
if (obj instanceof Video) {
|
||||||
@@ -115,6 +125,7 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
.append(size, other.size)
|
.append(size, other.size)
|
||||||
.append(key, other.key)
|
.append(key, other.key)
|
||||||
.append(language, other.language)
|
.append(language, other.language)
|
||||||
|
.append(country, other.country)
|
||||||
.isEquals();
|
.isEquals();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -130,6 +141,7 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
.append(key)
|
.append(key)
|
||||||
.append(site)
|
.append(site)
|
||||||
.append(language)
|
.append(language)
|
||||||
|
.append(country)
|
||||||
.toHashCode();
|
.toHashCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.omertron.themoviedbapi.model.movie;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||||
|
|
||||||
|
public class Release extends AbstractJsonMapping {
|
||||||
|
|
||||||
|
@JsonProperty("certification")
|
||||||
|
private String certification;
|
||||||
|
@JsonProperty("release_date")
|
||||||
|
private String releaseDate;
|
||||||
|
|
||||||
|
public String getCertification() {
|
||||||
|
return certification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCertification(String certification) {
|
||||||
|
this.certification = certification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReleaseDate() {
|
||||||
|
return releaseDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReleaseDate(String releaseDate) {
|
||||||
|
this.releaseDate = releaseDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
|
*
|
||||||
|
* This file is part of TheMovieDB API.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.omertron.themoviedbapi.model.movie;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||||
|
import com.omertron.themoviedbapi.enumeration.ReleaseType;
|
||||||
|
|
||||||
|
public class ReleaseDate extends Release {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
|
@JsonProperty("note")
|
||||||
|
private String note;
|
||||||
|
@JsonProperty("iso_639_1")
|
||||||
|
private String language;
|
||||||
|
private ReleaseType releaseType;
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLanguage() {
|
||||||
|
return language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLanguage(String language) {
|
||||||
|
this.language = language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReleaseType getType() {
|
||||||
|
return releaseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonSetter("type")
|
||||||
|
public void setType(int type) {
|
||||||
|
this.releaseType = ReleaseType.fromInteger(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.omertron.themoviedbapi.model.movie;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ReleaseDates extends AbstractJsonMapping {
|
||||||
|
|
||||||
|
@JsonProperty("iso_3166_1")
|
||||||
|
private String country;
|
||||||
|
@JsonProperty("release_dates")
|
||||||
|
private List<ReleaseDate> releaseDate;
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ReleaseDate> getReleaseDate() {
|
||||||
|
return releaseDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReleaseDate(List<ReleaseDate> releaseDate) {
|
||||||
|
this.releaseDate = releaseDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -19,7 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.omertron.themoviedbapi.model.movie;
|
package com.omertron.themoviedbapi.model.movie;
|
||||||
|
|
||||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||||
@@ -28,43 +27,23 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
/**
|
/**
|
||||||
* @author Stuart
|
* @author Stuart
|
||||||
*/
|
*/
|
||||||
public class ReleaseInfo extends AbstractJsonMapping implements Serializable {
|
public class ReleaseInfo extends Release implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 100L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("iso_3166_1")
|
@JsonProperty("iso_3166_1")
|
||||||
private String country;
|
private String country;
|
||||||
@JsonProperty("certification")
|
|
||||||
private String certification;
|
|
||||||
@JsonProperty("release_date")
|
|
||||||
private String releaseDate;
|
|
||||||
@JsonProperty("primary")
|
@JsonProperty("primary")
|
||||||
private boolean primary;
|
private boolean primary;
|
||||||
|
|
||||||
public String getCertification() {
|
|
||||||
return certification;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCountry() {
|
public String getCountry() {
|
||||||
return country;
|
return country;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getReleaseDate() {
|
|
||||||
return releaseDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCertification(String certification) {
|
|
||||||
this.certification = certification;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCountry(String country) {
|
public void setCountry(String country) {
|
||||||
this.country = country;
|
this.country = country;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReleaseDate(String releaseDate) {
|
|
||||||
this.releaseDate = releaseDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPrimary() {
|
public boolean isPrimary() {
|
||||||
return primary;
|
return primary;
|
||||||
}
|
}
|
||||||
@@ -78,9 +57,9 @@ public class ReleaseInfo extends AbstractJsonMapping implements Serializable {
|
|||||||
if (obj instanceof ReleaseInfo) {
|
if (obj instanceof ReleaseInfo) {
|
||||||
final ReleaseInfo other = (ReleaseInfo) obj;
|
final ReleaseInfo other = (ReleaseInfo) obj;
|
||||||
return new EqualsBuilder()
|
return new EqualsBuilder()
|
||||||
.append(country, other.country)
|
.append(getCountry(), other.getCountry())
|
||||||
.append(certification, other.certification)
|
.append(getCertification(), other.getCertification())
|
||||||
.append(releaseDate, other.releaseDate)
|
.append(getReleaseDate(), other.getReleaseDate())
|
||||||
.append(primary, other.primary)
|
.append(primary, other.primary)
|
||||||
.isEquals();
|
.isEquals();
|
||||||
} else {
|
} else {
|
||||||
@@ -91,9 +70,9 @@ public class ReleaseInfo extends AbstractJsonMapping implements Serializable {
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return new HashCodeBuilder()
|
return new HashCodeBuilder()
|
||||||
.append(country)
|
.append(getCountry())
|
||||||
.append(certification)
|
.append(getCertification())
|
||||||
.append(releaseDate)
|
.append(getReleaseDate())
|
||||||
.append(primary)
|
.append(primary)
|
||||||
.toHashCode();
|
.toHashCode();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ public class ExternalID extends AbstractJsonMapping implements Serializable, Ide
|
|||||||
private String tvdbId;
|
private String tvdbId;
|
||||||
@JsonProperty("tvrage_id")
|
@JsonProperty("tvrage_id")
|
||||||
private String tvrageId;
|
private String tvrageId;
|
||||||
|
@JsonProperty("facebook_id")
|
||||||
|
private String facebookId;
|
||||||
|
@JsonProperty("twitter_id")
|
||||||
|
private String twitterId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
@@ -95,4 +99,20 @@ public class ExternalID extends AbstractJsonMapping implements Serializable, Ide
|
|||||||
this.tvdbId = tvdbId;
|
this.tvdbId = tvdbId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFacebookId() {
|
||||||
|
return facebookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFacebookId(String facebookId) {
|
||||||
|
this.facebookId = facebookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTwitterId() {
|
||||||
|
return twitterId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTwitterId(String twitterId) {
|
||||||
|
this.twitterId = twitterId;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package com.omertron.themoviedbapi.model.person;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonSetter;
|
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||||
|
import com.omertron.themoviedbapi.enumeration.Gender;
|
||||||
import com.omertron.themoviedbapi.enumeration.PeopleMethod;
|
import com.omertron.themoviedbapi.enumeration.PeopleMethod;
|
||||||
import com.omertron.themoviedbapi.interfaces.AppendToResponse;
|
import com.omertron.themoviedbapi.interfaces.AppendToResponse;
|
||||||
import com.omertron.themoviedbapi.model.artwork.Artwork;
|
import com.omertron.themoviedbapi.model.artwork.Artwork;
|
||||||
@@ -62,6 +63,7 @@ public class PersonInfo extends PersonBasic implements Serializable, AppendToRes
|
|||||||
private String placeOfBirth;
|
private String placeOfBirth;
|
||||||
@JsonProperty("popularity")
|
@JsonProperty("popularity")
|
||||||
private float popularity;
|
private float popularity;
|
||||||
|
private Gender gender;
|
||||||
// AppendToResponse
|
// AppendToResponse
|
||||||
private final Set<PeopleMethod> methods = EnumSet.noneOf(PeopleMethod.class);
|
private final Set<PeopleMethod> methods = EnumSet.noneOf(PeopleMethod.class);
|
||||||
// AppendToResponse Properties
|
// AppendToResponse Properties
|
||||||
@@ -150,6 +152,15 @@ public class PersonInfo extends PersonBasic implements Serializable, AppendToRes
|
|||||||
methods.add(method);
|
methods.add(method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Gender getGender() {
|
||||||
|
return gender;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonSetter("gender")
|
||||||
|
public void setGender(int gender) {
|
||||||
|
this.gender = Gender.fromInteger(gender);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasMethod(PeopleMethod method) {
|
public boolean hasMethod(PeopleMethod method) {
|
||||||
return methods.contains(method);
|
return methods.contains(method);
|
||||||
|
|||||||
@@ -144,11 +144,9 @@ public class ApiUrl {
|
|||||||
// Append the key information
|
// Append the key information
|
||||||
urlString.append(DELIMITER_FIRST)
|
urlString.append(DELIMITER_FIRST)
|
||||||
.append(Param.API_KEY.getValue())
|
.append(Param.API_KEY.getValue())
|
||||||
.append(apiKey);
|
.append(apiKey)
|
||||||
|
.append(DELIMITER_SUBSEQUENT)// Append the search term
|
||||||
// Append the search term
|
.append(Param.QUERY.getValue());
|
||||||
urlString.append(DELIMITER_SUBSEQUENT);
|
|
||||||
urlString.append(Param.QUERY.getValue());
|
|
||||||
|
|
||||||
String query = (String) params.get(Param.QUERY);
|
String query = (String) params.get(Param.QUERY);
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public enum MethodSub {
|
|||||||
MOVIE_CREDITS("movie_credits"),
|
MOVIE_CREDITS("movie_credits"),
|
||||||
MOVIE_LIST("movie/list"),
|
MOVIE_LIST("movie/list"),
|
||||||
MULTI("multi"),
|
MULTI("multi"),
|
||||||
NOW_PLAYING("now-playing"),
|
NOW_PLAYING("now_playing"),
|
||||||
ON_THE_AIR("on_the_air"),
|
ON_THE_AIR("on_the_air"),
|
||||||
PERSON("person"),
|
PERSON("person"),
|
||||||
POPULAR("popular"),
|
POPULAR("popular"),
|
||||||
@@ -79,7 +79,8 @@ public enum MethodSub {
|
|||||||
VIDEOS("videos"),
|
VIDEOS("videos"),
|
||||||
WATCHLIST("watchlist"),
|
WATCHLIST("watchlist"),
|
||||||
WATCHLIST_MOVIES("watchlist/movies"),
|
WATCHLIST_MOVIES("watchlist/movies"),
|
||||||
WATCHLIST_TV("watchlist/tv");
|
WATCHLIST_TV("watchlist/tv"),
|
||||||
|
RELEASE_DATES("release_dates");
|
||||||
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
|
*
|
||||||
|
* This file is part of TheMovieDB API.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.omertron.themoviedbapi;
|
||||||
|
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test case for Debugging
|
||||||
|
*
|
||||||
|
* @author Stuart
|
||||||
|
*/
|
||||||
|
public class DebugTest extends AbstractTests {
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void setUpClass() throws MovieDbException {
|
||||||
|
doConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
LOG.info("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -39,6 +39,7 @@ import com.omertron.themoviedbapi.model.media.MediaState;
|
|||||||
import com.omertron.themoviedbapi.model.media.Translation;
|
import com.omertron.themoviedbapi.model.media.Translation;
|
||||||
import com.omertron.themoviedbapi.model.media.Video;
|
import com.omertron.themoviedbapi.model.media.Video;
|
||||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||||
|
import com.omertron.themoviedbapi.model.movie.ReleaseDates;
|
||||||
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
||||||
import com.omertron.themoviedbapi.model.review.Review;
|
import com.omertron.themoviedbapi.model.review.Review;
|
||||||
import com.omertron.themoviedbapi.results.ResultList;
|
import com.omertron.themoviedbapi.results.ResultList;
|
||||||
@@ -487,4 +488,33 @@ public class TmdbMoviesTest extends AbstractTests {
|
|||||||
TestSuite.test(result, "Top Rated");
|
TestSuite.test(result, "Top Rated");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test of getReleaseDates method, of class TmdbMovies.
|
||||||
|
*
|
||||||
|
* @throws com.omertron.themoviedbapi.MovieDbException
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testGetReleaseDates() throws MovieDbException {
|
||||||
|
LOG.info("getReleaseDates");
|
||||||
|
|
||||||
|
for (TestID test : FILM_IDS) {
|
||||||
|
ResultList<ReleaseDates> result = instance.getReleaseDates(test.getTmdb());
|
||||||
|
LOG.info("ID: {}, Page {} of {}, {} results", result.getId(), result.getPage(), result.getTotalPages(), result.getTotalResults());
|
||||||
|
|
||||||
|
TestSuite.test(result, "release dates");
|
||||||
|
|
||||||
|
// There should always be a US release
|
||||||
|
boolean found = false;
|
||||||
|
for (ReleaseDates check : result.getResults()) {
|
||||||
|
if ("US".equals(check.getCountry())) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assertTrue("No US release found", found);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user