Merging credits

master
Stuart Boston 11 years ago
parent 6984049f44
commit f6a09940c1

@ -78,7 +78,7 @@ import com.omertron.themoviedbapi.model.person.ContentRating;
import com.omertron.themoviedbapi.model.person.CreditInfo;
import com.omertron.themoviedbapi.model.person.ExternalID;
import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model.person.PersonCredits;
import com.omertron.themoviedbapi.model.person.PersonCreditList;
import com.omertron.themoviedbapi.model.person.PersonFind;
import com.omertron.themoviedbapi.model.review.Review;
import com.omertron.themoviedbapi.model.tv.TVBasic;
@ -1131,7 +1131,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public PersonCredits getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCreditList getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
return tmdbPeople.getPersonMovieCredits(personId, language, appendToResponse);
}
@ -1148,7 +1148,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public PersonCredits getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCreditList getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
return tmdbPeople.getPersonTVCredits(personId, language, appendToResponse);
}
@ -1165,7 +1165,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public PersonCredits getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCreditList getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
return tmdbPeople.getPersonCombinedCredits(personId, language, appendToResponse);
}

@ -27,12 +27,12 @@ import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER;
import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.artwork.ArtworkMedia;
import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.person.CreditBasic;
import com.omertron.themoviedbapi.model.person.CreditMovieBasic;
import com.omertron.themoviedbapi.model.person.CreditTVBasic;
import com.omertron.themoviedbapi.model.credits.CreditBasic;
import com.omertron.themoviedbapi.model.credits.CreditMovieBasic;
import com.omertron.themoviedbapi.model.credits.CreditTVBasic;
import com.omertron.themoviedbapi.model.person.ExternalID;
import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model.person.PersonCredits;
import com.omertron.themoviedbapi.model.person.PersonCreditList;
import com.omertron.themoviedbapi.model.person.PersonCreditsMixIn;
import com.omertron.themoviedbapi.model.person.PersonFind;
import com.omertron.themoviedbapi.results.ResultList;
@ -97,7 +97,7 @@ public class TmdbPeople extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public PersonCredits<CreditMovieBasic> getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCreditList<CreditMovieBasic> getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
@ -107,7 +107,7 @@ public class TmdbPeople extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
TypeReference tr = new TypeReference<PersonCredits<CreditMovieBasic>>() {
TypeReference tr = new TypeReference<PersonCreditList<CreditMovieBasic>>() {
};
return MAPPER.readValue(webpage, tr);
} catch (IOException ex) {
@ -130,7 +130,7 @@ public class TmdbPeople extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public PersonCredits<CreditTVBasic> getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCreditList<CreditTVBasic> getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
@ -140,7 +140,7 @@ public class TmdbPeople extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
TypeReference tr = new TypeReference<PersonCredits<CreditTVBasic>>() {
TypeReference tr = new TypeReference<PersonCreditList<CreditTVBasic>>() {
};
return MAPPER.readValue(webpage, tr);
} catch (IOException ex) {
@ -163,7 +163,7 @@ public class TmdbPeople extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public PersonCredits<CreditBasic> getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCreditList<CreditBasic> getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
@ -174,8 +174,8 @@ public class TmdbPeople extends AbstractMethod {
try {
ObjectMapper mapper = new ObjectMapper();
mapper.addMixIn(PersonCredits.class, PersonCreditsMixIn.class);
TypeReference tr = new TypeReference<PersonCredits<CreditBasic>>() {
mapper.addMixIn(PersonCreditList.class, PersonCreditsMixIn.class);
TypeReference tr = new TypeReference<PersonCreditList<CreditBasic>>() {
};
return mapper.readValue(webpage, tr);
} catch (IOException ex) {

@ -18,7 +18,7 @@
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model.person;
package com.omertron.themoviedbapi.model.credits;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
@ -43,7 +43,7 @@ public class CreditBasic extends AbstractJsonMapping implements Serializable, II
@JsonProperty("id")
private int id;
@JsonProperty("poster_path")
private String posterPath;
private String artworkPath;
//cast
@JsonProperty("character")
@ -93,12 +93,12 @@ public class CreditBasic extends AbstractJsonMapping implements Serializable, II
this.id = id;
}
public String getPosterPath() {
return posterPath;
public String getArtworkPath() {
return artworkPath;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
public void setArtworkPath(String artworkPath) {
this.artworkPath = artworkPath;
}
public String getCharacter() {

@ -17,7 +17,7 @@
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model.person;
package com.omertron.themoviedbapi.model.credits;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.enumeration.MediaType;

@ -17,7 +17,7 @@
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model.person;
package com.omertron.themoviedbapi.model.credits;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.enumeration.MediaType;

@ -17,7 +17,7 @@
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model.media;
package com.omertron.themoviedbapi.model.credits;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.interfaces.IIdentification;
@ -37,7 +37,7 @@ public class MediaCredit extends AbstractJsonMapping implements Serializable, II
@JsonProperty("id")
private int id;
@JsonProperty("profile_path")
private String profilePath;
private String artworkPath;
@JsonProperty("name")
private String name;
@ -59,12 +59,12 @@ public class MediaCredit extends AbstractJsonMapping implements Serializable, II
this.id = id;
}
public String getProfilePath() {
return profilePath;
public String getArtworkPath() {
return artworkPath;
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
public void setArtworkPath(String artworkPath) {
this.artworkPath = artworkPath;
}
public String getName() {

@ -17,7 +17,7 @@
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model.media;
package com.omertron.themoviedbapi.model.credits;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;

@ -17,7 +17,7 @@
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model.media;
package com.omertron.themoviedbapi.model.credits;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;

@ -19,6 +19,8 @@
*/
package com.omertron.themoviedbapi.model.media;
import com.omertron.themoviedbapi.model.credits.MediaCreditCrew;
import com.omertron.themoviedbapi.model.credits.MediaCreditCast;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.interfaces.IIdentification;
import com.omertron.themoviedbapi.model.AbstractJsonMapping;

@ -32,8 +32,8 @@ import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.collection.Collection;
import com.omertron.themoviedbapi.model.keyword.Keyword;
import com.omertron.themoviedbapi.model.list.UserList;
import com.omertron.themoviedbapi.model.media.MediaCreditCast;
import com.omertron.themoviedbapi.model.media.MediaCreditCrew;
import com.omertron.themoviedbapi.model.credits.MediaCreditCast;
import com.omertron.themoviedbapi.model.credits.MediaCreditCrew;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
import com.omertron.themoviedbapi.model.review.Review;
import com.omertron.themoviedbapi.results.WrapperAlternativeTitles;

@ -19,6 +19,7 @@
*/
package com.omertron.themoviedbapi.model.person;
import com.omertron.themoviedbapi.model.credits.CreditBasic;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.omertron.themoviedbapi.interfaces.IIdentification;
@ -30,7 +31,7 @@ import java.util.List;
* @author stuart.boston
* @param <T>
*/
public class PersonCredits<T extends CreditBasic> extends AbstractJsonMapping implements Serializable, IIdentification {
public class PersonCreditList<T extends CreditBasic> extends AbstractJsonMapping implements Serializable, IIdentification {
private static final long serialVersionUID = 4L;

@ -19,6 +19,9 @@
*/
package com.omertron.themoviedbapi.model.person;
import com.omertron.themoviedbapi.model.credits.CreditBasic;
import com.omertron.themoviedbapi.model.credits.CreditTVBasic;
import com.omertron.themoviedbapi.model.credits.CreditMovieBasic;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

@ -20,8 +20,8 @@
package com.omertron.themoviedbapi.model.tv;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.media.MediaCreditCast;
import com.omertron.themoviedbapi.model.media.MediaCreditCrew;
import com.omertron.themoviedbapi.model.credits.MediaCreditCast;
import com.omertron.themoviedbapi.model.credits.MediaCreditCrew;
import java.io.Serializable;
import java.util.List;

@ -27,7 +27,7 @@ import com.omertron.themoviedbapi.TestSuite;
import com.omertron.themoviedbapi.enumeration.ArtworkType;
import com.omertron.themoviedbapi.model.StatusCode;
import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.media.MediaCreditCast;
import com.omertron.themoviedbapi.model.credits.MediaCreditCast;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
import com.omertron.themoviedbapi.model.media.MediaState;
import com.omertron.themoviedbapi.model.media.Video;

@ -31,7 +31,7 @@ import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.change.ChangeListItem;
import com.omertron.themoviedbapi.model.keyword.Keyword;
import com.omertron.themoviedbapi.model.list.UserList;
import com.omertron.themoviedbapi.model.media.MediaCreditCast;
import com.omertron.themoviedbapi.model.credits.MediaCreditCast;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
import com.omertron.themoviedbapi.model.media.MediaState;
import com.omertron.themoviedbapi.model.media.AlternativeTitle;

@ -29,12 +29,12 @@ import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.artwork.ArtworkMedia;
import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.change.ChangeListItem;
import com.omertron.themoviedbapi.model.person.CreditBasic;
import com.omertron.themoviedbapi.model.person.CreditMovieBasic;
import com.omertron.themoviedbapi.model.person.CreditTVBasic;
import com.omertron.themoviedbapi.model.credits.CreditBasic;
import com.omertron.themoviedbapi.model.credits.CreditMovieBasic;
import com.omertron.themoviedbapi.model.credits.CreditTVBasic;
import com.omertron.themoviedbapi.model.person.ExternalID;
import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model.person.PersonCredits;
import com.omertron.themoviedbapi.model.person.PersonCreditList;
import com.omertron.themoviedbapi.model.person.PersonFind;
import com.omertron.themoviedbapi.results.ResultList;
import com.omertron.themoviedbapi.tools.MethodBase;
@ -116,7 +116,7 @@ public class TmdbPeopleTest extends AbstractTests {
String[] appendToResponse = null;
for (TestID test : testIDs) {
PersonCredits<CreditMovieBasic> result = instance.getPersonMovieCredits(test.getTmdb(), language, appendToResponse);
PersonCreditList<CreditMovieBasic> result = instance.getPersonMovieCredits(test.getTmdb(), language, appendToResponse);
LOG.info("ID: {}, # Cast: {}, # Crew: {}", result.getId(), result.getCast().size(), result.getCrew().size());
assertEquals("Incorrect ID", test.getTmdb(), result.getId());
TestSuite.test(result.getCast(), "Cast");
@ -140,7 +140,7 @@ public class TmdbPeopleTest extends AbstractTests {
String[] appendToResponse = null;
for (TestID test : testIDs) {
PersonCredits<CreditTVBasic> result = instance.getPersonTVCredits(test.getTmdb(), language, appendToResponse);
PersonCreditList<CreditTVBasic> result = instance.getPersonTVCredits(test.getTmdb(), language, appendToResponse);
LOG.info("ID: {}, # Cast: {}, # Crew: {}", result.getId(), result.getCast().size(), result.getCrew().size());
assertEquals("Incorrect ID", test.getTmdb(), result.getId());
TestSuite.test(result.getCast(), "Cast");
@ -164,7 +164,7 @@ public class TmdbPeopleTest extends AbstractTests {
String[] appendToResponse = null;
for (TestID test : testIDs) {
PersonCredits<CreditBasic> result = instance.getPersonCombinedCredits(test.getTmdb(), language, appendToResponse);
PersonCreditList<CreditBasic> result = instance.getPersonCombinedCredits(test.getTmdb(), language, appendToResponse);
LOG.info("ID: {}, # Cast: {}, # Crew: {}", result.getId(), result.getCast().size(), result.getCrew().size());
assertEquals("Incorrect ID", test.getTmdb(), result.getId());
TestSuite.test(result.getCast(), "Cast");

@ -26,7 +26,7 @@ import com.omertron.themoviedbapi.TestID;
import com.omertron.themoviedbapi.TestSuite;
import com.omertron.themoviedbapi.enumeration.ArtworkType;
import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.media.MediaCreditCast;
import com.omertron.themoviedbapi.model.credits.MediaCreditCast;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
import com.omertron.themoviedbapi.model.media.MediaState;
import com.omertron.themoviedbapi.model.media.Video;

@ -30,7 +30,7 @@ import com.omertron.themoviedbapi.model.artwork.Artwork;
import com.omertron.themoviedbapi.model.change.ChangeKeyItem;
import com.omertron.themoviedbapi.model.change.ChangeListItem;
import com.omertron.themoviedbapi.model.keyword.Keyword;
import com.omertron.themoviedbapi.model.media.MediaCreditCast;
import com.omertron.themoviedbapi.model.credits.MediaCreditCast;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
import com.omertron.themoviedbapi.model.media.MediaState;
import com.omertron.themoviedbapi.model.media.AlternativeTitle;

Loading…
Cancel
Save