use of com.zype.android.webapi.model.consumers.ConsumerFavoriteVideoData in project zype-android by zype.
the class FavoriteHelper method objectFromCursor.
@NonNull
public static ConsumerFavoriteVideoData objectFromCursor(@NonNull Cursor cursor) {
ConsumerFavoriteVideoData favorite = new ConsumerFavoriteVideoData();
favorite.setId(cursor.getString(cursor.getColumnIndex(Contract.Favorite.COLUMN_ID)));
favorite.setCreatedAt(cursor.getString(cursor.getColumnIndex(Contract.Favorite.COLUMN_CREATED_AT)));
favorite.setConsumerId(cursor.getString(cursor.getColumnIndex(Contract.Favorite.COLUMN_CONSUMER_ID)));
favorite.setDeletedAt(cursor.getString(cursor.getColumnIndex(Contract.Favorite.COLUMN_DELETED_AT)));
favorite.setUpdatedAt(cursor.getString(cursor.getColumnIndex(Contract.Favorite.COLUMN_UPDATED_AT)));
favorite.setVideoId(cursor.getString(cursor.getColumnIndex(Contract.Favorite.COLUMN_VIDEO_ID)));
return favorite;
}
use of com.zype.android.webapi.model.consumers.ConsumerFavoriteVideoData in project zype-android by zype.
the class FavoritesFragment method handleConsumerFavoriteVideo.
// ///////////
// Subscriptions
//
@Subscribe
public void handleConsumerFavoriteVideo(ConsumerFavoriteVideoEvent event) {
Logger.d("handleConsumerFavoriteVideo");
ConsumerFavoriteVideo favorite = event.getEventData().getModelData();
if (Pagination.hasNextPage(favorite.getPagination()) && !favorite.getResponse().isEmpty()) {
requestConsumerFavoriteVideo(Pagination.getNextPage(favorite.getPagination()));
}
DataHelper.insertFavorites(getActivity().getContentResolver(), favorite.getResponse());
// Retrieve videos
for (ConsumerFavoriteVideoData item : favorite.getResponse()) {
VideoParamsBuilder builder = new VideoParamsBuilder().addVideoId(item.getVideoId());
getApi().executeRequest(WebApiManager.Request.VIDEO_LIST, builder.build());
}
}
Aggregations