use of com.uwetrottmann.tmdb.entities.PersonCrewCredit in project philm by chrisbanes.
the class FetchTmdbPersonRunnable method onSuccess.
@Override
public void onSuccess(Person result) {
PhilmPerson person = getTmdbPersonEntityMapper().map(result);
if (person != null && result.movie_credits != null) {
if (!PhilmCollections.isEmpty(result.movie_credits.cast)) {
List<PhilmPersonCredit> credits = new ArrayList<>();
for (PersonCastCredit credit : result.movie_credits.cast) {
credits.add(new PhilmPersonCredit(credit));
}
Collections.sort(credits, PhilmPersonCredit.COMPARATOR_SORT_DATE);
person.setCastCredits(credits);
}
if (!PhilmCollections.isEmpty(result.movie_credits.crew)) {
List<PhilmPersonCredit> credits = new ArrayList<>();
for (PersonCrewCredit credit : result.movie_credits.crew) {
credits.add(new PhilmPersonCredit(credit));
}
Collections.sort(credits, PhilmPersonCredit.COMPARATOR_SORT_DATE);
person.setCrewCredits(credits);
}
person.setFetchedCredits(true);
getEventBus().post(new MoviesState.PersonChangedEvent(getCallingId(), person));
}
}
use of com.uwetrottmann.tmdb.entities.PersonCrewCredit in project philm by chrisbanes.
the class FetchTmdbPersonCreditsRunnable method onSuccess.
@Override
public void onSuccess(PersonCredits result) {
PhilmPerson person = mMoviesState.getPerson(mId);
if (person != null) {
if (!PhilmCollections.isEmpty(result.cast)) {
List<PhilmPersonCredit> credits = new ArrayList<>();
for (PersonCastCredit credit : result.cast) {
credits.add(new PhilmPersonCredit(credit));
}
Collections.sort(credits, PhilmPersonCredit.COMPARATOR_SORT_DATE);
person.setCastCredits(credits);
}
if (!PhilmCollections.isEmpty(result.crew)) {
List<PhilmPersonCredit> credits = new ArrayList<>();
for (PersonCrewCredit credit : result.crew) {
credits.add(new PhilmPersonCredit(credit));
}
Collections.sort(credits, PhilmPersonCredit.COMPARATOR_SORT_DATE);
person.setCrewCredits(credits);
}
person.setFetchedCredits(true);
getEventBus().post(new MoviesState.PersonChangedEvent(getCallingId(), person));
}
}
Aggregations