|
|
|
|
@ -43,7 +43,6 @@ import com.omertron.themoviedbapi.methods.TmdbTV;
|
|
|
|
|
import com.omertron.themoviedbapi.model.Account;
|
|
|
|
|
import com.omertron.themoviedbapi.model.AlternativeTitle;
|
|
|
|
|
import com.omertron.themoviedbapi.model.Artwork;
|
|
|
|
|
import com.omertron.themoviedbapi.model.ArtworkType;
|
|
|
|
|
import com.omertron.themoviedbapi.model.Certification;
|
|
|
|
|
import com.omertron.themoviedbapi.model.ChangedMedia;
|
|
|
|
|
import com.omertron.themoviedbapi.model.Collection;
|
|
|
|
|
@ -81,13 +80,10 @@ import com.omertron.themoviedbapi.tools.Param;
|
|
|
|
|
import com.omertron.themoviedbapi.tools.TmdbParameters;
|
|
|
|
|
import com.omertron.themoviedbapi.wrapper.WrapperCollection;
|
|
|
|
|
import com.omertron.themoviedbapi.wrapper.WrapperCompany;
|
|
|
|
|
import com.omertron.themoviedbapi.wrapper.WrapperImages;
|
|
|
|
|
import com.omertron.themoviedbapi.wrapper.WrapperKeywords;
|
|
|
|
|
import com.omertron.themoviedbapi.wrapper.WrapperMovie;
|
|
|
|
|
import com.omertron.themoviedbapi.wrapper.WrapperMovieList;
|
|
|
|
|
import com.omertron.themoviedbapi.wrapper.WrapperPerson;
|
|
|
|
|
import com.omertron.themoviedbapi.wrapper.WrapperPersonCredits;
|
|
|
|
|
import com.omertron.themoviedbapi.wrapper.WrapperPersonList;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@ -101,8 +97,7 @@ import org.yamj.api.common.http.SimpleHttpClientBuilder;
|
|
|
|
|
/**
|
|
|
|
|
* The MovieDb API
|
|
|
|
|
* <p>
|
|
|
|
|
* This is for version 3 of the API as specified here:
|
|
|
|
|
* http://help.themoviedb.org/kb/api/about-3
|
|
|
|
|
* This is for version 3 of the API as specified here: http://help.themoviedb.org/kb/api/about-3
|
|
|
|
|
*
|
|
|
|
|
* @author stuart.boston
|
|
|
|
|
*/
|
|
|
|
|
@ -205,8 +200,7 @@ public class TheMovieDbApi {
|
|
|
|
|
* @param moviedb The moviedb object to compare too
|
|
|
|
|
* @param title The title of the movie to compare
|
|
|
|
|
* @param year The year of the movie to compare
|
|
|
|
|
* @param maxDistance The Levenshtein Distance between the two titles. 0 =
|
|
|
|
|
* exact match
|
|
|
|
|
* @param maxDistance The Levenshtein Distance between the two titles. 0 = exact match
|
|
|
|
|
* @param caseSensitive true if the comparison is to be case sensitive
|
|
|
|
|
* @return True if there is a match, False otherwise.
|
|
|
|
|
*/
|
|
|
|
|
@ -286,154 +280,13 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to retrieve all of the basic person information.
|
|
|
|
|
*
|
|
|
|
|
* It will return the single highest rated profile image.
|
|
|
|
|
*
|
|
|
|
|
* @param personId
|
|
|
|
|
* @param appendToResponse
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public Person getPersonInfo(int personId, String... appendToResponse) throws MovieDbException {
|
|
|
|
|
TmdbParameters parameters = new TmdbParameters();
|
|
|
|
|
parameters.add(Param.ID, personId);
|
|
|
|
|
parameters.add(Param.APPEND, appendToResponse);
|
|
|
|
|
|
|
|
|
|
URL url = new ApiUrl(apiKey, MethodBase.PERSON).buildUrl(parameters);
|
|
|
|
|
String webpage = httpTools.getRequest(url);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
return MAPPER.readValue(webpage, Person.class);
|
|
|
|
|
} catch (IOException ex) {
|
|
|
|
|
LOG.warn("Failed to get person info: {}", ex.getMessage(), ex);
|
|
|
|
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, webpage, url, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to retrieve all of the cast & crew information for
|
|
|
|
|
* the person.
|
|
|
|
|
*
|
|
|
|
|
* It will return the single highest rated poster for each movie record.
|
|
|
|
|
*
|
|
|
|
|
* @param personId
|
|
|
|
|
* @param appendToResponse
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public TmdbResultsList<PersonCredit> getPersonCredits(int personId, String... appendToResponse) throws MovieDbException {
|
|
|
|
|
TmdbParameters parameters = new TmdbParameters();
|
|
|
|
|
parameters.add(Param.ID, personId);
|
|
|
|
|
parameters.add(Param.APPEND, appendToResponse);
|
|
|
|
|
|
|
|
|
|
URL url = new ApiUrl(apiKey, MethodBase.PERSON).setSubMethod(MethodSub.CREDITS).buildUrl(parameters);
|
|
|
|
|
String webpage = httpTools.getRequest(url);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
WrapperPersonCredits wrapper = MAPPER.readValue(webpage, WrapperPersonCredits.class);
|
|
|
|
|
TmdbResultsList<PersonCredit> results = new TmdbResultsList<PersonCredit>(wrapper.getAll());
|
|
|
|
|
results.copyWrapper(wrapper);
|
|
|
|
|
return results;
|
|
|
|
|
} catch (IOException ex) {
|
|
|
|
|
LOG.warn("Failed to get person credits: {}", ex.getMessage(), ex);
|
|
|
|
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, webpage, url, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to retrieve all of the profile images for a person.
|
|
|
|
|
*
|
|
|
|
|
* @param personId
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public TmdbResultsList<Artwork> getPersonImages(int personId) throws MovieDbException {
|
|
|
|
|
TmdbParameters parameters = new TmdbParameters();
|
|
|
|
|
parameters.add(Param.ID, personId);
|
|
|
|
|
|
|
|
|
|
URL url = new ApiUrl(apiKey, MethodBase.PERSON).setSubMethod(MethodSub.IMAGES).buildUrl(parameters);
|
|
|
|
|
String webpage = httpTools.getRequest(url);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
|
|
|
|
TmdbResultsList<Artwork> results = new TmdbResultsList<Artwork>(wrapper.getAll(ArtworkType.PROFILE));
|
|
|
|
|
results.copyWrapper(wrapper);
|
|
|
|
|
return results;
|
|
|
|
|
} catch (IOException ex) {
|
|
|
|
|
LOG.warn("Failed to get person images: {}", ex.getMessage(), ex);
|
|
|
|
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, webpage, url, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the list of popular people on The Movie Database.
|
|
|
|
|
*
|
|
|
|
|
* This list refreshes every day.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public TmdbResultsList<Person> getPersonPopular() throws MovieDbException {
|
|
|
|
|
return getPersonPopular(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the list of popular people on The Movie Database.
|
|
|
|
|
*
|
|
|
|
|
* This list refreshes every day.
|
|
|
|
|
*
|
|
|
|
|
* @param page
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public TmdbResultsList<Person> getPersonPopular(int page) throws MovieDbException {
|
|
|
|
|
TmdbParameters parameters = new TmdbParameters();
|
|
|
|
|
parameters.add(Param.PAGE, page);
|
|
|
|
|
|
|
|
|
|
URL url = new ApiUrl(apiKey, MethodBase.PERSON).setSubMethod(MethodSub.POPULAR).buildUrl(parameters);
|
|
|
|
|
String webpage = httpTools.getRequest(url);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
WrapperPersonList wrapper = MAPPER.readValue(webpage, WrapperPersonList.class);
|
|
|
|
|
TmdbResultsList<Person> results = new TmdbResultsList<Person>(wrapper.getPersonList());
|
|
|
|
|
results.copyWrapper(wrapper);
|
|
|
|
|
return results;
|
|
|
|
|
} catch (IOException ex) {
|
|
|
|
|
LOG.warn("Failed to get popular person: {}", ex.getMessage(), ex);
|
|
|
|
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, webpage, url, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the latest person id.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public Person getPersonLatest() throws MovieDbException {
|
|
|
|
|
URL url = new ApiUrl(apiKey, MethodBase.PERSON).setSubMethod(MethodSub.LATEST).buildUrl();
|
|
|
|
|
String webpage = httpTools.getRequest(url);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
return MAPPER.readValue(webpage, Person.class);
|
|
|
|
|
} catch (IOException ex) {
|
|
|
|
|
LOG.warn("Failed to get latest person: {}", ex.getMessage(), ex);
|
|
|
|
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, webpage, url, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Search Movies This is a good starting point to start finding movies on
|
|
|
|
|
* TMDb.
|
|
|
|
|
* Search Movies This is a good starting point to start finding movies on TMDb.
|
|
|
|
|
*
|
|
|
|
|
* @param movieName
|
|
|
|
|
* @param searchYear Limit the search to the provided year. Zero (0) will
|
|
|
|
|
* get all years
|
|
|
|
|
* @param searchYear Limit the search to the provided year. Zero (0) will get all years
|
|
|
|
|
* @param language The language to include. Can be blank/null.
|
|
|
|
|
* @param includeAdult true or false to include adult titles in the search
|
|
|
|
|
* @param page The page of results to return. 0 to get the default (first
|
|
|
|
|
* page)
|
|
|
|
|
* @param page The page of results to return. 0 to get the default (first page)
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
@ -492,8 +345,7 @@ public class TheMovieDbApi {
|
|
|
|
|
/**
|
|
|
|
|
* This is a good starting point to start finding people on TMDb.
|
|
|
|
|
*
|
|
|
|
|
* The idea is to be a quick and light method so you can iterate through
|
|
|
|
|
* people quickly.
|
|
|
|
|
* The idea is to be a quick and light method so you can iterate through people quickly.
|
|
|
|
|
*
|
|
|
|
|
* @param personName
|
|
|
|
|
* @param includeAdult
|
|
|
|
|
@ -553,8 +405,8 @@ public class TheMovieDbApi {
|
|
|
|
|
/**
|
|
|
|
|
* Search Companies.
|
|
|
|
|
*
|
|
|
|
|
* You can use this method to search for production companies that are part
|
|
|
|
|
* of TMDb. The company IDs will map to those returned on movie calls.
|
|
|
|
|
* You can use this method to search for production companies that are part of TMDb. The company IDs will map to those returned
|
|
|
|
|
* on movie calls.
|
|
|
|
|
*
|
|
|
|
|
* http://help.themoviedb.org/kb/api/search-companies
|
|
|
|
|
*
|
|
|
|
|
@ -611,8 +463,7 @@ public class TheMovieDbApi {
|
|
|
|
|
|
|
|
|
|
//<editor-fold defaultstate="collapsed" desc="Account">
|
|
|
|
|
/**
|
|
|
|
|
* Get the basic information for an account. You will need to have a valid
|
|
|
|
|
* session id.
|
|
|
|
|
* Get the basic information for an account. You will need to have a valid session id.
|
|
|
|
|
*
|
|
|
|
|
* @param sessionId
|
|
|
|
|
* @return
|
|
|
|
|
@ -752,16 +603,13 @@ public class TheMovieDbApi {
|
|
|
|
|
|
|
|
|
|
//<editor-fold defaultstate="collapsed" desc="Authentication">
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to generate a valid request token for user based
|
|
|
|
|
* authentication.
|
|
|
|
|
* This method is used to generate a valid request token for user based authentication.
|
|
|
|
|
*
|
|
|
|
|
* A request token is required in order to request a session id.
|
|
|
|
|
*
|
|
|
|
|
* You can generate any number of request tokens but they will expire after
|
|
|
|
|
* 60 minutes.
|
|
|
|
|
* You can generate any number of request tokens but they will expire after 60 minutes.
|
|
|
|
|
*
|
|
|
|
|
* As soon as a valid session id has been created the token will be
|
|
|
|
|
* destroyed.
|
|
|
|
|
* As soon as a valid session id has been created the token will be destroyed.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
@ -771,8 +619,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to generate a session id for user based
|
|
|
|
|
* authentication.
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
@ -785,8 +632,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to generate a session id for user based
|
|
|
|
|
* authentication. User must provide their username and password
|
|
|
|
|
* This method is used to generate a session id for user based authentication. User must provide their username and password
|
|
|
|
|
*
|
|
|
|
|
* A session id is required in order to use any of the write methods.
|
|
|
|
|
*
|
|
|
|
|
@ -803,18 +649,14 @@ public class TheMovieDbApi {
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
* A guest session can be used to rate movies without having a registered TMDb user account.
|
|
|
|
|
*
|
|
|
|
|
* You should only generate a single guest session per user (or device) as
|
|
|
|
|
* you will be able to attach the ratings to a TMDb user account in the
|
|
|
|
|
* future.
|
|
|
|
|
* You should only generate a single guest session per user (or device) as you will be able to attach the ratings to a TMDb user
|
|
|
|
|
* account in the future.
|
|
|
|
|
*
|
|
|
|
|
* There are also IP limits in place so you should always make sure it's the
|
|
|
|
|
* end user doing the guest session actions.
|
|
|
|
|
* There are also IP limits in place so you should always make sure it's the end user doing the guest session actions.
|
|
|
|
|
*
|
|
|
|
|
* If a guest session is not used for the first time within 24 hours, it
|
|
|
|
|
* will be automatically discarded.
|
|
|
|
|
* If a guest session is not used for the first time within 24 hours, it will be automatically discarded.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
@ -854,13 +696,11 @@ public class TheMovieDbApi {
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* TODO: DOES NOT WORK AT THE MOMENT. This is due to the "value" item
|
|
|
|
|
* changing type in the ChangeItem
|
|
|
|
|
* TODO: DOES NOT WORK AT THE MOMENT. This is due to the "value" item changing type in the ChangeItem
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @param startDate the start date of the changes, optional
|
|
|
|
|
@ -879,13 +719,11 @@ public class TheMovieDbApi {
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* TODO: DOES NOT WORK AT THE MOMENT. This is due to the "value" item
|
|
|
|
|
* changing type in the ChangeItem
|
|
|
|
|
* TODO: DOES NOT WORK AT THE MOMENT. This is due to the "value" item changing type in the ChangeItem
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @param startDate the start date of the changes, optional
|
|
|
|
|
@ -904,8 +742,7 @@ public class TheMovieDbApi {
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
@ -922,8 +759,7 @@ public class TheMovieDbApi {
|
|
|
|
|
/**
|
|
|
|
|
* Get a list of Movie IDs that have been edited.
|
|
|
|
|
*
|
|
|
|
|
* You can then use the movie changes API to get the actual data that has
|
|
|
|
|
* been changed.
|
|
|
|
|
* You can then use the movie changes API to get the actual data that has been changed.
|
|
|
|
|
*
|
|
|
|
|
* @param page
|
|
|
|
|
* @param startDate the start date of the changes, optional
|
|
|
|
|
@ -938,8 +774,7 @@ public class TheMovieDbApi {
|
|
|
|
|
/**
|
|
|
|
|
* Get a list of TV IDs that have been edited.
|
|
|
|
|
*
|
|
|
|
|
* You can then use the TV changes API to get the actual data that has been
|
|
|
|
|
* changed.
|
|
|
|
|
* You can then use the TV changes API to get the actual data that has been changed.
|
|
|
|
|
*
|
|
|
|
|
* @param page
|
|
|
|
|
* @param startDate the start date of the changes, optional
|
|
|
|
|
@ -954,8 +789,7 @@ public class TheMovieDbApi {
|
|
|
|
|
/**
|
|
|
|
|
* Get a list of Person IDs that have been edited.
|
|
|
|
|
*
|
|
|
|
|
* You can then use the person changes API to get the actual data that has
|
|
|
|
|
* been changed.
|
|
|
|
|
* You can then use the person changes API to get the actual data that has been changed.
|
|
|
|
|
*
|
|
|
|
|
* @param page
|
|
|
|
|
* @param startDate the start date of the changes, optional
|
|
|
|
|
@ -970,11 +804,9 @@ public class TheMovieDbApi {
|
|
|
|
|
|
|
|
|
|
//<editor-fold defaultstate="collapsed" desc="Collections">
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to retrieve all of the basic information about a
|
|
|
|
|
* movie collection.
|
|
|
|
|
* This method is used to retrieve all of the basic information about a movie collection.
|
|
|
|
|
*
|
|
|
|
|
* You can get the ID needed for this method by making a getMovieInfo
|
|
|
|
|
* request for the belongs_to_collection.
|
|
|
|
|
* You can get the ID needed for this method by making a getMovieInfo request for the belongs_to_collection.
|
|
|
|
|
*
|
|
|
|
|
* @param collectionId
|
|
|
|
|
* @param language
|
|
|
|
|
@ -1000,8 +832,7 @@ public class TheMovieDbApi {
|
|
|
|
|
|
|
|
|
|
//<editor-fold defaultstate="collapsed" desc="Companies">
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to retrieve the basic information about a production
|
|
|
|
|
* company on TMDb.
|
|
|
|
|
* This method is used to retrieve the basic information about a production company on TMDb.
|
|
|
|
|
*
|
|
|
|
|
* @param companyId
|
|
|
|
|
* @return
|
|
|
|
|
@ -1014,8 +845,7 @@ public class TheMovieDbApi {
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to retrieve the movies associated with a company.
|
|
|
|
|
*
|
|
|
|
|
* These movies are returned in order of most recently released to oldest.
|
|
|
|
|
* The default response will return 20 movies per page.
|
|
|
|
|
* These movies are returned in order of most recently released to oldest. The default response will return 20 movies per page.
|
|
|
|
|
*
|
|
|
|
|
* TODO: Implement more than 20 movies
|
|
|
|
|
*
|
|
|
|
|
@ -1070,14 +900,11 @@ public class TheMovieDbApi {
|
|
|
|
|
* <p>
|
|
|
|
|
* This is currently only supported with the new credit model found in TV.
|
|
|
|
|
* <br/>
|
|
|
|
|
* These IDs can be found from any TV credit response as well as the
|
|
|
|
|
* TV_credits and combined_credits methods for people. <br/>
|
|
|
|
|
* The episodes object returns a list of episodes and are generally going to
|
|
|
|
|
* be guest stars. <br/>
|
|
|
|
|
* These IDs can be found from any TV credit response as well as the TV_credits and combined_credits methods for people. <br/>
|
|
|
|
|
* The episodes object returns a list of episodes and are generally going to be guest stars. <br/>
|
|
|
|
|
* The season array will return a list of season numbers. <br/>
|
|
|
|
|
* Season credits are credits that were marked with the "add to every
|
|
|
|
|
* season" option in the editing interface and are assumed to be "season
|
|
|
|
|
* regulars".
|
|
|
|
|
* Season credits are credits that were marked with the "add to every season" option in the editing interface and are assumed to
|
|
|
|
|
* be "season regulars".
|
|
|
|
|
*
|
|
|
|
|
* @param creditId
|
|
|
|
|
* @param language
|
|
|
|
|
@ -1091,8 +918,7 @@ public class TheMovieDbApi {
|
|
|
|
|
|
|
|
|
|
//<editor-fold defaultstate="collapsed" desc="Discover">
|
|
|
|
|
/**
|
|
|
|
|
* Discover movies by different types of data like average rating, number of
|
|
|
|
|
* votes, genres and certifications.
|
|
|
|
|
* Discover movies by different types of data like average rating, number of votes, genres and certifications.
|
|
|
|
|
*
|
|
|
|
|
* @param discover A discover object containing the search criteria required
|
|
|
|
|
* @return
|
|
|
|
|
@ -1103,8 +929,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Discover movies by different types of data like average rating, number of
|
|
|
|
|
* votes, genres and certifications.
|
|
|
|
|
* Discover movies by different types of data like average rating, number of votes, genres and certifications.
|
|
|
|
|
*
|
|
|
|
|
* @param discover A discover object containing the search criteria required
|
|
|
|
|
* @return
|
|
|
|
|
@ -1117,18 +942,16 @@ public class TheMovieDbApi {
|
|
|
|
|
|
|
|
|
|
//<editor-fold defaultstate="collapsed" desc="Find">
|
|
|
|
|
/**
|
|
|
|
|
* You con use this method to find movies, tv series or persons using
|
|
|
|
|
* external ids.
|
|
|
|
|
* You con use this method to find movies, tv series or persons using external ids.
|
|
|
|
|
*
|
|
|
|
|
* Supported query ids are
|
|
|
|
|
* <ul>
|
|
|
|
|
* <li>Movies: imdb_id</li>
|
|
|
|
|
* <li>People: imdb_id, freebase_mid, freebase_id, tvrage_id</li>
|
|
|
|
|
* <li>TV Series: imdb_id, freebase_mid, freebase_id, tvdb_id,
|
|
|
|
|
* tvrage_id</li>
|
|
|
|
|
* <li>TV Series: imdb_id, freebase_mid, freebase_id, tvdb_id, tvrage_id</li>
|
|
|
|
|
* <li>TV Seasons: freebase_mid, freebase_id, tvdb_id, tvrage_id</li>
|
|
|
|
|
* <li>TV Episodes: imdb_id, freebase_mid, freebase_id, tvdb_id,
|
|
|
|
|
* tvrage_idimdb_id, freebase_mid, freebase_id, tvrage_id, tvdb_id.
|
|
|
|
|
* <li>TV Episodes: imdb_id, freebase_mid, freebase_id, tvdb_id, tvrage_idimdb_id, freebase_mid, freebase_id, tvrage_id,
|
|
|
|
|
* tvdb_id.
|
|
|
|
|
* </ul>
|
|
|
|
|
*
|
|
|
|
|
* For details see http://docs.themoviedb.apiary.io/#find
|
|
|
|
|
@ -1161,11 +984,9 @@ public class TheMovieDbApi {
|
|
|
|
|
/**
|
|
|
|
|
* Get a list of movies per genre.
|
|
|
|
|
*
|
|
|
|
|
* It is important to understand that only movies with more than 10 votes
|
|
|
|
|
* get listed.
|
|
|
|
|
* It is important to understand that only movies with more than 10 votes get listed.
|
|
|
|
|
*
|
|
|
|
|
* This prevents movies from 1 10/10 rating from being listed first and for
|
|
|
|
|
* the first 5 pages.
|
|
|
|
|
* This prevents movies from 1 10/10 rating from being listed first and for the first 5 pages.
|
|
|
|
|
*
|
|
|
|
|
* @param genreId
|
|
|
|
|
* @param language
|
|
|
|
|
@ -1243,8 +1064,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method lets users add new movies to a list that they created. A
|
|
|
|
|
* valid session id is required.
|
|
|
|
|
* This method lets users add new movies to a list that they created. A valid session id is required.
|
|
|
|
|
*
|
|
|
|
|
* @param sessionId
|
|
|
|
|
* @param listId
|
|
|
|
|
@ -1257,8 +1077,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method lets users remove movies from a list that they created. A
|
|
|
|
|
* valid session id is required.
|
|
|
|
|
* This method lets users remove movies from a list that they created. A valid session id is required.
|
|
|
|
|
*
|
|
|
|
|
* @param sessionId
|
|
|
|
|
* @param listId
|
|
|
|
|
@ -1271,8 +1090,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method lets users delete a list that they created. A valid session
|
|
|
|
|
* id is required.
|
|
|
|
|
* This method lets users delete a list that they created. A valid session id is required.
|
|
|
|
|
*
|
|
|
|
|
* @param sessionId
|
|
|
|
|
* @param listId
|
|
|
|
|
@ -1290,8 +1108,7 @@ public class TheMovieDbApi {
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
@ -1308,8 +1125,7 @@ public class TheMovieDbApi {
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
@ -1322,8 +1138,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
@ -1350,8 +1165,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method should be used when you’re wanting to retrieve all of the
|
|
|
|
|
* images for a particular movie.
|
|
|
|
|
* This method should be used when you’re wanting to retrieve all of the images for a particular movie.
|
|
|
|
|
*
|
|
|
|
|
* @param movieId
|
|
|
|
|
* @param language
|
|
|
|
|
@ -1364,8 +1178,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
@ -1379,8 +1192,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
@ -1393,8 +1205,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
@ -1409,8 +1220,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
@ -1422,11 +1232,9 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
*
|
|
|
|
|
@ -1488,8 +1296,7 @@ public class TheMovieDbApi {
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* TODO: Implement more than 20 movies
|
|
|
|
|
*
|
|
|
|
|
@ -1519,8 +1326,7 @@ public class TheMovieDbApi {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
@ -1567,9 +1373,81 @@ public class TheMovieDbApi {
|
|
|
|
|
//</editor-fold>
|
|
|
|
|
|
|
|
|
|
//<editor-fold defaultstate="collapsed" desc="People">
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to retrieve all of the basic person information.
|
|
|
|
|
*
|
|
|
|
|
* It will return the single highest rated profile image.
|
|
|
|
|
*
|
|
|
|
|
* @param personId
|
|
|
|
|
* @param appendToResponse
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public Person getPersonInfo(int personId, String... appendToResponse) throws MovieDbException {
|
|
|
|
|
return tmdbPeople.getPersonInfo(personId, appendToResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//</editor-fold>
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to retrieve all of the cast & crew information for the person.
|
|
|
|
|
*
|
|
|
|
|
* It will return the single highest rated poster for each movie record.
|
|
|
|
|
*
|
|
|
|
|
* @param personId
|
|
|
|
|
* @param appendToResponse
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public TmdbResultsList<PersonCredit> getPersonCredits(int personId, String... appendToResponse) throws MovieDbException {
|
|
|
|
|
return tmdbPeople.getPersonCredits(personId, appendToResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method is used to retrieve all of the profile images for a person.
|
|
|
|
|
*
|
|
|
|
|
* @param personId
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public TmdbResultsList<Artwork> getPersonImages(int personId) throws MovieDbException {
|
|
|
|
|
return tmdbPeople.getPersonImages(personId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the list of popular people on The Movie Database.
|
|
|
|
|
*
|
|
|
|
|
* This list refreshes every day.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public TmdbResultsList<Person> getPersonPopular() throws MovieDbException {
|
|
|
|
|
return tmdbPeople.getPersonPopular(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the list of popular people on The Movie Database.
|
|
|
|
|
*
|
|
|
|
|
* This list refreshes every day.
|
|
|
|
|
*
|
|
|
|
|
* @param page
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public TmdbResultsList<Person> getPersonPopular(int page) throws MovieDbException {
|
|
|
|
|
return tmdbPeople.getPersonPopular(page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the latest person id.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* @throws MovieDbException
|
|
|
|
|
*/
|
|
|
|
|
public Person getPersonLatest() throws MovieDbException {
|
|
|
|
|
return tmdbPeople.getPersonLatest();
|
|
|
|
|
}
|
|
|
|
|
//</editor-fold>
|
|
|
|
|
|
|
|
|
|
//<editor-fold defaultstate="collapsed" desc="Reviews">
|
|
|
|
|
//</editor-fold>
|
|
|
|
|
//<editor-fold defaultstate="collapsed" desc="Search">
|
|
|
|
|
|