use of android.content.ContentValues in project SeriesGuide by UweTrottmann.
the class MovieTools method buildMoviesContentValues.
private static ContentValues[] buildMoviesContentValues(List<MovieDetails> movies) {
ContentValues[] valuesArray = new ContentValues[movies.size()];
int index = 0;
for (MovieDetails movie : movies) {
valuesArray[index] = buildMovieContentValues(movie);
index++;
}
return valuesArray;
}
use of android.content.ContentValues in project SeriesGuide by UweTrottmann.
the class MovieTools method updateMovie.
private static boolean updateMovie(Context context, int movieTmdbId, String column, boolean value) {
ContentValues values = new ContentValues();
values.put(column, value);
int rowsUpdated = context.getContentResolver().update(SeriesGuideContract.Movies.buildMovieUri(movieTmdbId), values, null, null);
return rowsUpdated > 0;
}
use of android.content.ContentValues in project SeriesGuide by UweTrottmann.
the class TraktRatingsTask method saveShowRating.
private void saveShowRating(Ratings ratings) {
ContentValues values = new ContentValues();
values.put(SeriesGuideContract.Shows.RATING_GLOBAL, ratings.rating);
values.put(SeriesGuideContract.Shows.RATING_VOTES, ratings.votes);
context.getContentResolver().update(SeriesGuideContract.Shows.buildShowUri(showTvdbId), values, null, null);
}
use of android.content.ContentValues in project SeriesGuide by UweTrottmann.
the class AddListTask method doDatabaseUpdate.
protected boolean doDatabaseUpdate(String listId) {
ContentValues values = new ContentValues();
values.put(SeriesGuideContract.Lists.LIST_ID, listId);
values.put(SeriesGuideContract.Lists.NAME, listName);
getContext().getContentResolver().insert(SeriesGuideContract.Lists.CONTENT_URI, values);
// notify lists activity
EventBus.getDefault().post(new ListsActivity.ListsChangedEvent());
return true;
}
use of android.content.ContentValues in project SeriesGuide by UweTrottmann.
the class RateEpisodeTask method doDatabaseUpdate.
@Override
protected boolean doDatabaseUpdate() {
ContentValues values = new ContentValues();
values.put(SeriesGuideContract.Episodes.RATING_USER, getRating().value);
int rowsUpdated = getContext().getContentResolver().update(SeriesGuideContract.Episodes.buildEpisodeUri(episodeTvdbId), values, null, null);
// notify withshow uri as well (used by episode details view)
getContext().getContentResolver().notifyChange(SeriesGuideContract.Episodes.buildEpisodeWithShowUri(episodeTvdbId), null);
return rowsUpdated > 0;
}
Aggregations