Search in sources :

Example 1 with Movie

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);
    }
}
Also used : Movie(butter.droid.provider.base.model.Movie) Media(butter.droid.provider.base.model.Media) IOException(java.io.IOException)

Example 2 with Movie

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()));
    }
}
Also used : Movie(butter.droid.provider.base.model.Movie) Torrent(butter.droid.provider.base.model.Torrent)

Example 3 with Movie

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);
}
Also used : Torrent(butter.droid.provider.base.model.Torrent) Movie(butter.droid.provider.base.model.Movie) TorrentHealth(butter.droid.base.torrent.TorrentHealth)

Aggregations

Movie (butter.droid.provider.base.model.Movie)3 Torrent (butter.droid.provider.base.model.Torrent)2 TorrentHealth (butter.droid.base.torrent.TorrentHealth)1 Media (butter.droid.provider.base.model.Media)1 IOException (java.io.IOException)1