use of org.javaee7.movieplex7.entities.Movie in project SeriesGuide by UweTrottmann.
the class MigrationTest method getTestMovieDetails.
private static MovieDetails getTestMovieDetails(@Nullable Integer tmdbId) {
MovieDetails movieDetails = new MovieDetails();
Movie tmdbMovie = new Movie();
if (tmdbId != null) {
tmdbMovie.id = tmdbId;
} else {
tmdbMovie.id = 12;
}
movieDetails.tmdbMovie(tmdbMovie);
return movieDetails;
}
use of org.javaee7.movieplex7.entities.Movie in project SeriesGuide by UweTrottmann.
the class TraktTask method buildComment.
@Nullable
private Comment buildComment() {
Comment comment = new Comment();
comment.comment = args.getString(InitBundle.MESSAGE);
comment.spoiler = args.getBoolean(InitBundle.ISSPOILER);
// episode?
long episodeId = args.getLong(InitBundle.EPISODE_ID);
if (episodeId != 0) {
// Check in using episode TMDB ID
// Note: using show Trakt ID and episode numbers does not work (comments on show).
int episodeTmdbIdOrZero = SgRoomDatabase.getInstance(context).sgEpisode2Helper().getEpisodeTmdbId(episodeId);
if (episodeTmdbIdOrZero == 0) {
Timber.e("Failed to get episode %d", episodeId);
return null;
}
comment.episode = new Episode();
comment.episode.ids = EpisodeIds.tmdb(episodeTmdbIdOrZero);
return comment;
}
// show?
long showId = args.getLong(InitBundle.SHOW_ID);
if (showId != 0) {
Integer showTraktId = ShowTools.getShowTraktId(context, showId);
if (showTraktId == null) {
Timber.e("Failed to get show %d", showId);
return null;
}
comment.show = new Show();
comment.show.ids = ShowIds.trakt(showTraktId);
return comment;
}
// movie!
int movieTmdbId = args.getInt(InitBundle.MOVIE_TMDB_ID);
comment.movie = new Movie();
comment.movie.ids = MovieIds.tmdb(movieTmdbId);
return comment;
}
use of org.javaee7.movieplex7.entities.Movie in project SeriesGuide by UweTrottmann.
the class MovieTools method loadSummaryFromTmdb.
@Nullable
private com.uwetrottmann.tmdb2.entities.Movie loadSummaryFromTmdb(@Nullable String languageCode, String regionCode, int movieTmdbId) {
// try to get local movie summary
Movie movie = getMovieSummary("get local movie summary", languageCode, movieTmdbId, true);
if (movie != null && !TextUtils.isEmpty(movie.overview)) {
movieTools2.updateReleaseDateForRegion(movie, movie.release_dates, regionCode);
return movie;
}
// fall back to default language if TMDb has no localized text
Movie movieFallback = getMovieSummary("get default movie summary", null, movieTmdbId, false);
if (movieFallback != null) {
// add note about non-translated or non-existing overview
String untranslatedOverview = movieFallback.overview;
movieFallback.overview = TextToolsK.textNoTranslationMovieLanguage(context, languageCode);
if (!TextUtils.isEmpty(untranslatedOverview)) {
movieFallback.overview += "\n\n" + untranslatedOverview;
}
if (movie != null) {
movieTools2.updateReleaseDateForRegion(movie, movie.release_dates, regionCode);
}
}
return movieFallback;
}
Aggregations