diff --git a/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java b/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java index 0a12e1a9a..23c6a00ec 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java @@ -29,6 +29,7 @@ import com.omertron.themoviedbapi.model2.collection.Collection; import com.omertron.themoviedbapi.model2.company.Company; import com.omertron.themoviedbapi.model2.list.UserList; import com.omertron.themoviedbapi.model2.movie.MovieBasic; +import com.omertron.themoviedbapi.model2.person.PersonFind; import com.omertron.themoviedbapi.model2.tv.TVBasic; import com.omertron.themoviedbapi.tools.HttpTools; import com.omertron.themoviedbapi.wrapper.WrapperGenericList; @@ -76,6 +77,8 @@ public class AbstractMethod { }); TYPE_REFS.put(Person.class, new TypeReference>() { }); + TYPE_REFS.put(PersonFind.class, new TypeReference>() { + }); } protected static TypeReference getTypeReference(Class aClass) { diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java index 8fbc76df1..570e6365c 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbSearch.java @@ -23,10 +23,10 @@ import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.enumeration.SearchType; import com.omertron.themoviedbapi.model.MovieDb; 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; +import com.omertron.themoviedbapi.model2.person.PersonFind; import com.omertron.themoviedbapi.model2.tv.TVBasic; import com.omertron.themoviedbapi.results.TmdbResultsList; import com.omertron.themoviedbapi.tools.ApiUrl; @@ -220,7 +220,7 @@ public class TmdbSearch extends AbstractMethod { * @return * @throws MovieDbException */ - public TmdbResultsList searchPeople(String query, Integer page, Boolean includeAdult, SearchType searchType) throws MovieDbException { + public TmdbResultsList searchPeople(String query, Integer page, Boolean includeAdult, SearchType searchType) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.QUERY, query); parameters.add(Param.ADULT, includeAdult); @@ -230,8 +230,8 @@ public class TmdbSearch extends AbstractMethod { } URL url = new ApiUrl(apiKey, MethodBase.SEARCH).setSubMethod(MethodSub.PERSON).buildUrl(parameters); - WrapperGenericList wrapper = processWrapper(getTypeReference(Person.class), url, "person"); - TmdbResultsList results = new TmdbResultsList(wrapper.getResults()); + WrapperGenericList wrapper = processWrapper(getTypeReference(PersonFind.class), url, "person"); + TmdbResultsList results = new TmdbResultsList(wrapper.getResults()); results.copyWrapper(wrapper); return results; } diff --git a/src/main/java/com/omertron/themoviedbapi/model2/person/PersonFind.java b/src/main/java/com/omertron/themoviedbapi/model2/person/PersonFind.java index cbf3a9484..879226e51 100644 --- a/src/main/java/com/omertron/themoviedbapi/model2/person/PersonFind.java +++ b/src/main/java/com/omertron/themoviedbapi/model2/person/PersonFind.java @@ -41,7 +41,6 @@ public class PersonFind extends PersonBasic { private Float popularity; @JsonProperty("profile_path") private String profilePath; -// @JsonProperty("known_for") private List knownFor; public Boolean getAdult() { @@ -74,7 +73,6 @@ public class PersonFind extends PersonBasic { @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, -// include = JsonTypeInfo.As.EXTERNAL_PROPERTY, include = JsonTypeInfo.As.PROPERTY, property = "media_type", defaultImpl = MediaBasic.class diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java index 2dc6c1891..33f92fbfb 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbSearchTest.java @@ -24,10 +24,10 @@ import com.omertron.themoviedbapi.MovieDbException; import com.omertron.themoviedbapi.enumeration.SearchType; import com.omertron.themoviedbapi.model.MovieDb; 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; +import com.omertron.themoviedbapi.model2.person.PersonFind; import com.omertron.themoviedbapi.model2.tv.TVBasic; import com.omertron.themoviedbapi.results.TmdbResultsList; import org.junit.After; @@ -183,7 +183,7 @@ public class TmdbSearchTest extends AbstractTests { public void testSearchPeople() throws MovieDbException { LOG.info("searchPeople"); String personName = "Bruce Willis"; - TmdbResultsList result = instance.searchPeople(personName, null, null, SearchType.PHRASE); + TmdbResultsList result = instance.searchPeople(personName, null, null, SearchType.PHRASE); assertNotNull("Null results", result); assertNotNull("Null people", result.getResults()); assertFalse("Empty people", result.isEmpty());