use of butter.droid.provider.base.model.Show in project butter-android by butterproject.
the class RecommendationService method buildShowRecommendations.
private void buildShowRecommendations(@NonNull RecommendationBuilder builder) {
Timber.d("building show recommendations");
try {
int count = 0;
for (Media media : shows) {
Show show = (Show) media;
Timber.d("Recommendation - " + show.getTitle());
Episode latestEpisode = findLatestEpisode(show);
priority--;
totalCount--;
builder.setBackgroundContentUri(RecommendationContentProvider.CONTENT_URI + URLEncoder.encode(show.getBackdrop(), "UTF-8")).setId(totalCount).setPriority(priority).setTitle(show.getTitle()).setDescription(latestEpisode == null ? "" : getString(R.string.episode_number_format, latestEpisode.getEpisode())).setImage(show.getPoster()).build();
if (++count >= MAX_SHOW_RECOMMENDATIONS) {
break;
}
}
} catch (IOException e) {
Timber.e("Unable to update recommendation", e);
}
}
Aggregations