diff --git a/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java b/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java index 5b0d9a9d4..b92aaa491 100644 --- a/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java +++ b/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java @@ -43,20 +43,20 @@ import com.omertron.themoviedbapi.methods.TmdbReviews; import com.omertron.themoviedbapi.methods.TmdbSearch; import com.omertron.themoviedbapi.methods.TmdbTV; import com.omertron.themoviedbapi.model.AlternativeTitle; -import com.omertron.themoviedbapi.model.Certification; +import com.omertron.themoviedbapi.model2.Certification; import com.omertron.themoviedbapi.model.Genre; import com.omertron.themoviedbapi.model.MovieDb; import com.omertron.themoviedbapi.model.MovieList; import com.omertron.themoviedbapi.model.ReleaseInfo; import com.omertron.themoviedbapi.model.Translation; import com.omertron.themoviedbapi.model.Video; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model.keyword.KeywordMovie; -import com.omertron.themoviedbapi.model.person.Person; import com.omertron.themoviedbapi.model2.FindResults; import com.omertron.themoviedbapi.model2.StatusCode; import com.omertron.themoviedbapi.model2.account.Account; import com.omertron.themoviedbapi.model2.artwork.Artwork; +import com.omertron.themoviedbapi.model2.artwork.ArtworkMedia; import com.omertron.themoviedbapi.model2.authentication.TokenAuthorisation; import com.omertron.themoviedbapi.model2.authentication.TokenSession; import com.omertron.themoviedbapi.model2.change.ChangeListItem; @@ -71,12 +71,19 @@ import com.omertron.themoviedbapi.model2.list.UserList; import com.omertron.themoviedbapi.model2.movie.MovieBasic; import com.omertron.themoviedbapi.model2.network.Network; import com.omertron.themoviedbapi.model2.person.CreditInfo; +import com.omertron.themoviedbapi.model2.person.CreditMovieBasic; +import com.omertron.themoviedbapi.model2.person.CreditTVBasic; +import com.omertron.themoviedbapi.model2.person.ExternalID; +import com.omertron.themoviedbapi.model2.person.Person; +import com.omertron.themoviedbapi.model2.person.PersonCredits; +import com.omertron.themoviedbapi.model2.person.PersonFind; import com.omertron.themoviedbapi.model2.review.Review; import com.omertron.themoviedbapi.model2.tv.TVBasic; import com.omertron.themoviedbapi.results.TmdbResultsList; import com.omertron.themoviedbapi.results.TmdbResultsMap; import com.omertron.themoviedbapi.tools.HttpTools; import com.omertron.themoviedbapi.tools.MethodBase; +import com.omertron.themoviedbapi.wrapper.WrapperChanges; import java.net.URL; import java.util.List; import java.util.Map; @@ -945,7 +952,7 @@ public class TheMovieDbApi { * @return * @throws MovieDbException */ - public TmdbResultsList getMovieCasts(int movieId, String... appendToResponse) throws MovieDbException { + public TmdbResultsList getMovieCasts(int movieId, String... appendToResponse) throws MovieDbException { return tmdbMovies.getMovieCasts(movieId, appendToResponse); } @@ -1154,10 +1161,145 @@ public class TheMovieDbApi { // // + /** + * Get the general person information for a specific id. + * + * @param personId + * @param appendToResponse + * @return + * @throws MovieDbException + */ + public Person getPersonInfo(int personId, String... appendToResponse) throws MovieDbException { + return tmdbPeople.getPersonInfo(personId, appendToResponse); + } - //TODO: Methods here + /** + * Get the movie credits for a specific person id. + * + * @param personId + * @param language + * @param appendToResponse + * @return + * @throws MovieDbException + */ + public PersonCredits getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException { + return tmdbPeople.getPersonMovieCredits(personId, language, appendToResponse); + } + /** + * Get the TV credits for a specific person id. + * + * To get the expanded details for each 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 PersonCredits getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException { + return tmdbPeople.getPersonTVCredits(personId, language, appendToResponse); + } + /** + * 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 PersonCredits getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException { + return tmdbPeople.getPersonCombinedCredits(personId, language, appendToResponse); + } + + /** + * Get the external ids for a specific person id. + * + * @param personId + * @return + * @throws MovieDbException + */ + public ExternalID getPersonExternalIds(int personId) throws MovieDbException { + return tmdbPeople.getPersonExternalIds(personId); + } + + /** + * Get the images for a specific person id. + * + * @param personId + * @return + * @throws MovieDbException + */ + public TmdbResultsList getPersonImages(int personId) throws MovieDbException { + return tmdbPeople.getPersonImages(personId); + } + + /** + * 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 + * @throws com.omertron.themoviedbapi.MovieDbException + */ + public TmdbResultsList getPersonTaggedImages(int personId, Integer page, String language) throws MovieDbException { + return tmdbPeople.getPersonTaggedImages(personId, page, language); + } + + /** + * 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 personId + * @param startDate + * @param endDate + * @return + * @throws com.omertron.themoviedbapi.MovieDbException + */ + public WrapperChanges getPersonChanges(int personId, String startDate, String endDate) throws MovieDbException { + return tmdbPeople.getPersonChanges(personId, startDate, endDate); + } + + /** + * Get the list of popular people on The Movie Database. + * + * This list refreshes every day. + * + * @param page + * @return + * @throws MovieDbException + */ + public TmdbResultsList getPersonPopular(Integer page) throws MovieDbException { + return tmdbPeople.getPersonPopular(page); + } + + /** + * Get the latest person id. + * + * @return + * @throws MovieDbException + */ + public Person getPersonLatest() throws MovieDbException { + return tmdbPeople.getPersonLatest(); + } // // diff --git a/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java b/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java index fbe77808c..ce864bf8a 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java @@ -23,7 +23,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.model.MovieDb; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model.person.Person; import com.omertron.themoviedbapi.model2.collection.Collection; import com.omertron.themoviedbapi.model2.company.Company; diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java index f17ab64ee..31596d0ea 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbCertifications.java @@ -25,7 +25,7 @@ import com.omertron.themoviedbapi.tools.HttpTools; import java.util.List; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; -import com.omertron.themoviedbapi.model.Certification; +import com.omertron.themoviedbapi.model2.Certification; import com.omertron.themoviedbapi.tools.ApiUrl; import com.omertron.themoviedbapi.tools.MethodBase; import com.omertron.themoviedbapi.tools.MethodSub; diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbChanges.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbChanges.java index 7869aface..81b39fc78 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbChanges.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbChanges.java @@ -69,11 +69,8 @@ public class TmdbChanges extends AbstractMethod { params.add(Param.END_DATE, endDate); URL url = new ApiUrl(apiKey, method).setSubMethod(MethodSub.CHANGES).buildUrl(params); - String webpage = httpTools.getRequest(url); - TypeReference tr = new TypeReference>() { }; - return processWrapperList(tr, url, "changes"); } diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java index 83a262f6e..5b04f11dc 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java @@ -20,7 +20,7 @@ package com.omertron.themoviedbapi.methods; import com.omertron.themoviedbapi.MovieDbException; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model.keyword.KeywordMovie; import com.omertron.themoviedbapi.results.TmdbResultsList; import com.omertron.themoviedbapi.tools.ApiUrl; diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java index b17fbb1f6..a0cc63299 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java @@ -28,7 +28,7 @@ import com.omertron.themoviedbapi.model.ReleaseInfo; import com.omertron.themoviedbapi.model2.StatusCode; import com.omertron.themoviedbapi.model.Translation; import com.omertron.themoviedbapi.model.Video; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model.person.Person; import com.omertron.themoviedbapi.results.TmdbResultsList; import com.omertron.themoviedbapi.tools.ApiUrl; diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java index 6ad84b4a8..8fbc76df1 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java @@ -22,8 +22,8 @@ package com.omertron.themoviedbapi.methods; import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.enumeration.SearchType; import com.omertron.themoviedbapi.model.MovieDb; -import com.omertron.themoviedbapi.model.keyword.Keyword; -import com.omertron.themoviedbapi.model.person.Person; +import com.omertron.themoviedbapi.model2.keyword.Keyword; +import com.omertron.themoviedbapi.model2.person.Person; import com.omertron.themoviedbapi.model2.collection.Collection; import com.omertron.themoviedbapi.model2.company.Company; import com.omertron.themoviedbapi.model2.list.UserList; diff --git a/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java b/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java index 5a6226bea..35ae03da9 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java +++ b/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java @@ -23,7 +23,7 @@ import com.omertron.themoviedbapi.model2.artwork.Artwork; import com.omertron.themoviedbapi.model2.review.Review; import com.omertron.themoviedbapi.model2.AbstractJsonMapping; import com.omertron.themoviedbapi.model2.collection.Collection; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model.person.PersonCast; import com.omertron.themoviedbapi.model.person.PersonCrew; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/omertron/themoviedbapi/model/Certification.java b/src/main/java/com/omertron/themoviedbapi/model2/Certification.java similarity index 97% rename from src/main/java/com/omertron/themoviedbapi/model/Certification.java rename to src/main/java/com/omertron/themoviedbapi/model2/Certification.java index c794d9155..b6e885fcf 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Certification.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/Certification.java @@ -17,7 +17,7 @@ * along with TheMovieDB API. If not;private see . * */ -package com.omertron.themoviedbapi.model; +package com.omertron.themoviedbapi.model2; import com.omertron.themoviedbapi.model2.AbstractJsonMapping; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/omertron/themoviedbapi/model/keyword/Keyword.java b/src/main/java/com/omertron/themoviedbapi/model2/keyword/Keyword.java similarity index 95% rename from src/main/java/com/omertron/themoviedbapi/model/keyword/Keyword.java rename to src/main/java/com/omertron/themoviedbapi/model2/keyword/Keyword.java index 00a6b6184..c6006b431 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/keyword/Keyword.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/keyword/Keyword.java @@ -17,7 +17,7 @@ * along with TheMovieDB API. If not, see . * */ -package com.omertron.themoviedbapi.model.keyword; +package com.omertron.themoviedbapi.model2.keyword; import com.fasterxml.jackson.annotation.JsonRootName; import com.omertron.themoviedbapi.model.AbstractIdName; diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywords.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywords.java index 7b6bc4547..c734c60fe 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywords.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywords.java @@ -20,7 +20,7 @@ package com.omertron.themoviedbapi.wrapper; import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import java.util.List; /** diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieKeywords.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieKeywords.java index a52a4955e..f15e62a93 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieKeywords.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieKeywords.java @@ -20,7 +20,7 @@ package com.omertron.themoviedbapi.wrapper; import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import java.io.Serializable; import java.util.List; diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbCertificationsTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbCertificationsTest.java index fe7f220ea..5909474a1 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbCertificationsTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbCertificationsTest.java @@ -22,7 +22,7 @@ package com.omertron.themoviedbapi.methods; import com.omertron.themoviedbapi.AbstractTests; import static com.omertron.themoviedbapi.AbstractTests.doConfiguration; import com.omertron.themoviedbapi.MovieDbException; -import com.omertron.themoviedbapi.model.Certification; +import com.omertron.themoviedbapi.model2.Certification; import com.omertron.themoviedbapi.results.TmdbResultsMap; import java.util.List; import java.util.Map; diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbKeywordsTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbKeywordsTest.java index 2e163fdb0..810611460 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbKeywordsTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbKeywordsTest.java @@ -21,7 +21,7 @@ package com.omertron.themoviedbapi.methods; import com.omertron.themoviedbapi.AbstractTests; import com.omertron.themoviedbapi.MovieDbException; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model.keyword.KeywordMovie; import com.omertron.themoviedbapi.results.TmdbResultsList; import org.junit.After; diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbMoviesTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbMoviesTest.java index c0a3c2140..cde79704f 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbMoviesTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbMoviesTest.java @@ -23,7 +23,7 @@ import com.omertron.themoviedbapi.AbstractTests; import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.model.AlternativeTitle; import com.omertron.themoviedbapi.model2.artwork.Artwork; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model.MovieDb; import com.omertron.themoviedbapi.model.MovieList; import com.omertron.themoviedbapi.model.ReleaseInfo; diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java index 113ee72d6..997ebf9a3 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java @@ -23,7 +23,7 @@ import com.omertron.themoviedbapi.AbstractTests; import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.enumeration.SearchType; import com.omertron.themoviedbapi.model.MovieDb; -import com.omertron.themoviedbapi.model.keyword.Keyword; +import com.omertron.themoviedbapi.model2.keyword.Keyword; import com.omertron.themoviedbapi.model.person.Person; import com.omertron.themoviedbapi.model2.collection.Collection; import com.omertron.themoviedbapi.model2.company.Company;