use of com.uwetrottmann.tmdb.entities.CastMember in project philm by chrisbanes.
the class FetchTmdbMovieCreditsRunnable method onSuccess.
@Override
public void onSuccess(Credits result) {
PhilmMovie movie = mMoviesState.getMovie(mId);
if (movie != null) {
if (!PhilmCollections.isEmpty(result.cast)) {
// Sort the Cast based on order first
Collections.sort(result.cast, new Comparator<CastMember>() {
@Override
public int compare(CastMember castMember, CastMember castMember2) {
return castMember.order - castMember2.order;
}
});
movie.setCast(getTmdbCastEntityMapper().mapCredits(result.cast));
}
if (!PhilmCollections.isEmpty(result.crew)) {
List<PhilmMovieCredit> crew = getTmdbCrewEntityMapper().mapCredits(result.crew);
Collections.sort(crew);
movie.setCrew(crew);
}
getEventBus().post(new MoviesState.MovieCastItemsUpdatedEvent(getCallingId(), movie));
}
}
use of com.uwetrottmann.tmdb.entities.CastMember in project philm by chrisbanes.
the class TmdbCastEntityMapper method mapCredits.
public List<PhilmMovieCredit> mapCredits(List<CastMember> entities) {
final ArrayList<PhilmMovieCredit> credits = new ArrayList<>(entities.size());
for (CastMember entity : entities) {
credits.add(new PhilmMovieCredit(map(entity), entity.character, entity.order));
}
Collections.sort(credits);
return credits;
}
Aggregations