use of butter.droid.provider.base.model.Movie in project butter-android by butterproject.
the class RecommendationService method buildMovieRecommendations.
private void buildMovieRecommendations(@NonNull RecommendationBuilder builder) {
Timber.d("building movie recommendations");
try {
int count = 0;
for (Media media : movies) {
Movie movie = (Movie) media;
Timber.d("Recommendation - " + movie.getTitle());
priority--;
totalCount--;
builder.setBackgroundContentUri(RecommendationContentProvider.CONTENT_URI + URLEncoder.encode(movie.getBackdrop(), "UTF-8")).setId(totalCount).setPriority(priority).setTitle(movie.getTitle()).setDescription(movie.getSynopsis()).setImage(movie.getPoster()).build();
if (++count >= MAX_MOVIE_RECOMMENDATIONS) {
break;
}
}
} catch (IOException e) {
Timber.e("Unable to update recommendation", e);
}
}
use of butter.droid.provider.base.model.Movie in project butter-android by butterproject.
the class TVStreamableDetailsPresenterImpl method actionClicked.
@Override
public void actionClicked(final long actionId) {
Movie movie = (Movie) item.getMedia();
if (actionId == ACTION_TRAILER) {
view.startTrailer(item, movie.getTrailer());
} else {
Torrent torrent = movie.getTorrents()[(int) actionId];
view.startMovie(item, torrent, mediaDisplayManager.getFormatDisplayName(torrent.getFormat()));
}
}
use of butter.droid.provider.base.model.Movie in project butter-android by butterproject.
the class MediaDetailPresenterImpl method healthClicked.
@Override
public void healthClicked() {
Torrent torrent;
if (selectedTorrent != null) {
torrent = selectedTorrent;
} else {
Movie movie = (Movie) this.media.getMedia();
torrent = movie.getTorrents()[0];
}
int seeds = torrent.getSeeds();
int peers = torrent.getPeers();
TorrentHealth health = TorrentHealth.calculate(seeds, peers);
view.displayHealthInfo(health, seeds, peers);
}
Aggregations