Stub methods

master
Stuart Boston 11 years ago
parent d97e39c77e
commit 45b66ef0b1

@ -22,6 +22,7 @@ package com.omertron.themoviedbapi.methods;
import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.model.Artwork; import com.omertron.themoviedbapi.model.Artwork;
import com.omertron.themoviedbapi.enumeration.ArtworkType; import com.omertron.themoviedbapi.enumeration.ArtworkType;
import static com.omertron.themoviedbapi.methods.AbstractMethod.getTypeReference;
import com.omertron.themoviedbapi.model.person.Person; import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model.person.PersonCredit; import com.omertron.themoviedbapi.model.person.PersonCredit;
import com.omertron.themoviedbapi.results.TmdbResultsList; import com.omertron.themoviedbapi.results.TmdbResultsList;
@ -31,8 +32,8 @@ import com.omertron.themoviedbapi.tools.MethodBase;
import com.omertron.themoviedbapi.tools.MethodSub; import com.omertron.themoviedbapi.tools.MethodSub;
import com.omertron.themoviedbapi.tools.Param; import com.omertron.themoviedbapi.tools.Param;
import com.omertron.themoviedbapi.tools.TmdbParameters; import com.omertron.themoviedbapi.tools.TmdbParameters;
import com.omertron.themoviedbapi.wrapper.WrapperGenericList;
import com.omertron.themoviedbapi.wrapper.WrapperImages; import com.omertron.themoviedbapi.wrapper.WrapperImages;
import com.omertron.themoviedbapi.wrapper.WrapperPersonCredits;
import com.omertron.themoviedbapi.wrapper.WrapperPersonList; import com.omertron.themoviedbapi.wrapper.WrapperPersonList;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
@ -56,9 +57,7 @@ public class TmdbPeople extends AbstractMethod {
} }
/** /**
* This method is used to retrieve all of the basic person information. * Get the general person information for a specific id.
*
* It will return the single highest rated profile image.
* *
* @param personId * @param personId
* @param appendToResponse * @param appendToResponse
@ -81,35 +80,74 @@ public class TmdbPeople extends AbstractMethod {
} }
/** /**
* This method is used to retrieve all of the cast & crew information for the person. * Get the movie credits for a specific person id.
*
* It will return the single highest rated poster for each movie record.
* *
* @param personId * @param personId
* @param language
* @param appendToResponse * @param appendToResponse
* @return * @return
* @throws MovieDbException * @throws MovieDbException
*/ */
public TmdbResultsList<PersonCredit> getPersonCredits(int personId, String... appendToResponse) throws MovieDbException { public TmdbResultsList<PersonCredit> getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters(); TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId); parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.APPEND, appendToResponse); parameters.add(Param.APPEND, appendToResponse);
URL url = new ApiUrl(apiKey, MethodBase.PERSON).setSubMethod(MethodSub.MOVIE_CREDITS).buildUrl(parameters);
URL url = new ApiUrl(apiKey, MethodBase.PERSON).setSubMethod(MethodSub.CREDITS).buildUrl(parameters); WrapperGenericList<PersonCredit> wrapper = processWrapper(getTypeReference(PersonCredit.class), url, "person movie credits");
String webpage = httpTools.getRequest(url); TmdbResultsList<PersonCredit> results = new TmdbResultsList<PersonCredit>(wrapper.getResults());
results.copyWrapper(wrapper);
return results;
}
try { /**
WrapperPersonCredits wrapper = MAPPER.readValue(webpage, WrapperPersonCredits.class); * Get the TV credits for a specific person id.
TmdbResultsList<PersonCredit> results = new TmdbResultsList<PersonCredit>(wrapper.getAll()); *
results.copyWrapper(wrapper); * To get the expanded details for each record, call the /credit method with the provided credit_id.
return results; *
} catch (IOException ex) { * This will provide details about which episode and/or season the credit is for.
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person credits", url, ex); *
} * @param personId
* @param language
* @param appendToResponse
* @return
* @throws MovieDbException
*/
public TmdbResultsList<Person> getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
return null;
}
/**
* Get the combined (movie and TV) credits for a specific person id.
*
* To get the expanded details for each TV record, call the /credit method with the provided credit_id.
*
* This will provide details about which episode and/or season the credit is for.
*
* @param personId
* @param language
* @param appendToResponse
* @return
* @throws MovieDbException
*/
public TmdbResultsList<Person> getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
return null;
} }
/** /**
* This method is used to retrieve all of the profile images for a person. * Get the external ids for a specific person id.
*
* @param personId
* @return
* @throws MovieDbException
*/
public TmdbResultsList<Person> getPersonExternalIds(int personId) throws MovieDbException {
return null;
}
/**
* Get the images for a specific person id.
* *
* @param personId * @param personId
* @return * @return
@ -132,6 +170,40 @@ public class TmdbPeople extends AbstractMethod {
} }
} }
/**
* Get the images that have been tagged with a specific person id.
*
* We return all of the image results with a media object mapped for each image.
*
* @param personId
* @param page
* @param language
* @return
*/
public TmdbResultsList<Person> getPersonTaggedImages(int personId, Integer page, String language) {
return null;
}
/**
* Get the changes for a specific person id.
*
* Changes are grouped by key, and ordered by date in descending order.
*
* 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 language is present on fields that are translatable.
*
* @param persondId
* @param startDate
* @param endDate
* @return
*/
public TmdbResultsList<Person> getPersonChanges(int persondId, String startDate, String endDate) {
return null;
}
/** /**
* Get the list of popular people on The Movie Database. * Get the list of popular people on The Movie Database.
* *
@ -141,7 +213,7 @@ public class TmdbPeople extends AbstractMethod {
* @return * @return
* @throws MovieDbException * @throws MovieDbException
*/ */
public TmdbResultsList<Person> getPersonPopular(int page) throws MovieDbException { public TmdbResultsList<Person> getPersonPopular(Integer page) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters(); TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.PAGE, page); parameters.add(Param.PAGE, page);
@ -175,8 +247,4 @@ public class TmdbPeople extends AbstractMethod {
} }
} }
int getPersonMovieCredits(int ID_BRUCE_WILLIS, String LANGUAGE_DEFAULT) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
} }

@ -30,6 +30,7 @@ public enum MethodSub {
CHANGES("changes"), CHANGES("changes"),
CLEAR("clear"), CLEAR("clear"),
COLLECTION("collection"), COLLECTION("collection"),
COMBINED_CREDITS("combined_credits"),
COMPANY("company"), COMPANY("company"),
CREDITS("credits"), CREDITS("credits"),
FAVORITE("favorite"), FAVORITE("favorite"),
@ -45,6 +46,7 @@ public enum MethodSub {
LISTS("lists"), LISTS("lists"),
MOVIE("movie"), MOVIE("movie"),
MOVIES("movies"), MOVIES("movies"),
MOVIE_CREDITS("movie_credits"),
MOVIE_LIST("movie/list"), MOVIE_LIST("movie/list"),
MULTI("multi"), MULTI("multi"),
NOW_PLAYING("now-playing"), NOW_PLAYING("now-playing"),
@ -64,6 +66,7 @@ public enum MethodSub {
TOP_RATED("top-rated"), TOP_RATED("top-rated"),
TRANSLATIONS("translations"), TRANSLATIONS("translations"),
TV("tv"), TV("tv"),
TV_CREDITS("tv_credits"),
TV_LIST("tv/list"), TV_LIST("tv/list"),
UPCOMING("upcoming"), UPCOMING("upcoming"),
VIDEOS("videos"), VIDEOS("videos"),

Loading…
Cancel
Save