Search in sources :

Example 21 with Movie

use of com.uwetrottmann.trakt5.entities.Movie in project SeriesGuide by UweTrottmann.

the class MovieTools method loadSummaryFromTmdb.

@Nullable
private com.uwetrottmann.tmdb2.entities.Movie loadSummaryFromTmdb(String languageCode, int movieTmdbId) {
    // try to get local movie summary
    Movie movie = getMovieSummary("get local movie summary", languageCode, movieTmdbId);
    if (movie != null && !TextUtils.isEmpty(movie.overview)) {
        return movie;
    }
    // fall back to default language if TMDb has no localized text
    movie = getMovieSummary("get default movie summary", null, movieTmdbId);
    if (movie != null) {
        // add note about non-translated or non-existing overview
        String untranslatedOverview = movie.overview;
        movie.overview = context.getString(R.string.no_translation, LanguageTools.getMovieLanguageStringFor(context, languageCode), context.getString(R.string.tmdb));
        if (!TextUtils.isEmpty(untranslatedOverview)) {
            movie.overview += "\n\n" + untranslatedOverview;
        }
    }
    return movie;
}
Also used : Movie(com.uwetrottmann.tmdb2.entities.Movie) BaseMovie(com.uwetrottmann.trakt5.entities.BaseMovie) SyncMovie(com.uwetrottmann.trakt5.entities.SyncMovie) Nullable(android.support.annotation.Nullable)

Example 22 with Movie

use of com.uwetrottmann.trakt5.entities.Movie in project javaee7-firstcup by ecabrerar.

the class MovieReader method readFrom.

@Override
public Movie readFrom(Class<Movie> type, Type type1, Annotation[] antns, MediaType mt, MultivaluedMap<String, String> mm, InputStream in) throws IOException, WebApplicationException {
    Movie movie = new Movie();
    JsonParser parser = Json.createParser(in);
    while (parser.hasNext()) {
        switch(parser.next()) {
            case KEY_NAME:
                String key = parser.getString();
                parser.next();
                switch(key) {
                    case "id":
                        movie.setId(parser.getInt());
                        break;
                    case "name":
                        movie.setName(parser.getString());
                        break;
                    case "actors":
                        movie.setActors(parser.getString());
                        break;
                    default:
                        break;
                }
                break;
            default:
                break;
        }
    }
    return movie;
}
Also used : Movie(org.javaee7.movieplex7.entities.Movie) JsonParser(javax.json.stream.JsonParser)

Example 23 with Movie

use of com.uwetrottmann.trakt5.entities.Movie in project javaee7-firstcup by ecabrerar.

the class MovieClientBean method addMovie.

public void addMovie() {
    Movie m = new Movie();
    m.setId(bean.getMovieId());
    m.setName(bean.getMovieName());
    m.setActors(bean.getActors());
    target.register(MovieWriter.class).request().post(Entity.entity(m, MediaType.APPLICATION_JSON));
}
Also used : Movie(org.javaee7.movieplex7.entities.Movie)

Example 24 with Movie

use of com.uwetrottmann.trakt5.entities.Movie in project nzbhydra2 by theotherp.

the class TmdbHandler method fromTitle.

TmdbSearchResult fromTitle(String title, Integer year) throws InfoProviderException {
    Movie movie = getMovieByTitle(title, year);
    TmdbSearchResult result = getSearchResultFromMovie(movie);
    return result;
}
Also used : Movie(com.uwetrottmann.tmdb2.entities.Movie)

Example 25 with Movie

use of com.uwetrottmann.trakt5.entities.Movie in project nzbhydra2 by theotherp.

the class TmdbHandler method fromTmdb.

private TmdbSearchResult fromTmdb(String imdbId) throws InfoProviderException {
    Movie movie = getMovieByTmdbId(imdbId);
    TmdbSearchResult result = getSearchResultFromMovie(movie);
    return result;
}
Also used : Movie(com.uwetrottmann.tmdb2.entities.Movie)

Aggregations

Movie (com.uwetrottmann.tmdb2.entities.Movie)14 IOException (java.io.IOException)7 ArrayList (java.util.ArrayList)7 SyncMovie (com.uwetrottmann.trakt5.entities.SyncMovie)5 List (java.util.List)5 OperationApplicationException (android.content.OperationApplicationException)4 LinkedList (java.util.LinkedList)4 ContentProviderOperation (android.content.ContentProviderOperation)3 Nullable (androidx.annotation.Nullable)3 HistoryEntry (com.uwetrottmann.trakt5.entities.HistoryEntry)3 Intent (android.content.Intent)2 Nullable (android.support.annotation.Nullable)2 MovieDetails (com.battlelancer.seriesguide.ui.movies.MovieDetails)2 MovieList (com.uwetrottmann.seriesguide.backend.movies.model.MovieList)2 BaseMovie (com.uwetrottmann.trakt5.entities.BaseMovie)2 Comment (com.uwetrottmann.trakt5.entities.Comment)2 Episode (com.uwetrottmann.trakt5.entities.Episode)2 Friend (com.uwetrottmann.trakt5.entities.Friend)2 LastActivities (com.uwetrottmann.trakt5.entities.LastActivities)2 Ratings (com.uwetrottmann.trakt5.entities.Ratings)2