use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.
the class FetchTraktDetailMovieRunnable method onSuccess.
@Override
public void onSuccess(Movie result) {
PhilmMovie movie = getTraktMovieEntityMapper().map(result);
movie.markFullFetchCompleted(PhilmModel.TYPE_TRAKT);
checkPhilmState(movie);
getDbHelper().put(movie);
getEventBus().post(new MoviesState.MovieInformationUpdatedEvent(getCallingId(), movie));
}
use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.
the class FetchTraktDetailMovieRunnable method onError.
@Override
public void onError(RetrofitError re) {
if (re.getResponse() != null && re.getResponse().getStatus() == 404) {
PhilmMovie movie = mMoviesState.getMovie(mId);
if (movie != null) {
getDbHelper().put(movie);
getEventBus().post(new MoviesState.MovieInformationUpdatedEvent(getCallingId(), movie));
}
}
super.onError(re);
}
use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.
the class FetchTraktRelatedMoviesRunnable method onSuccess.
@Override
public void onSuccess(List<Movie> result) {
PhilmMovie movie = mMoviesState.getMovie(mId);
movie.setRelated(getTraktMovieEntityMapper().mapAll(result));
getEventBus().post(new MoviesState.MovieRelatedItemsUpdatedEvent(getCallingId(), movie));
}
use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.
the class FetchTraktWatchingRunnable method onSuccess.
@Override
public void onSuccess(WatchingBase result) {
if (result.type == ActivityType.Movie && WatchingMovie.validAction(result.action)) {
PhilmMovie movie = getTraktMovieEntityMapper().map(result.movie);
if (movie != null) {
// TODO Fix timestamps
WatchingMovie watching = new WatchingMovie(movie, WatchingMovie.from(result.action), 0, 0);
mMoviesState.setWatchingMovie(watching);
}
}
}
use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.
the class BaseTraktActionRunnable method onSuccessfulAction.
private PhilmMovie onSuccessfulAction(final String movieId) {
PhilmMovie movie = mMoviesState.getMovie(movieId);
if (movie != null) {
movieRequiresModifying(movie);
checkPhilmState(movie);
return movie;
}
return null;
}
Aggregations