use of com.zype.android.zypeapi.model.VideoEntitlementData in project zype-android by zype.
the class DataRepository method updateVideoEntitlements.
private void updateVideoEntitlements(List<VideoEntitlementData> entitlements) {
for (VideoEntitlementData item : entitlements) {
Video video = getVideoSync(item.videoId);
if (video == null) {
loadVideo(item.videoId, response -> {
if (response.isSuccessful) {
Video dbVideo = getVideoSync(item.videoId);
if (dbVideo != null) {
dbVideo.isEntitled = 1;
dbVideo.entitlementUpdatedAt = item.createdAt;
updateVideo(dbVideo);
}
}
});
} else {
video.isEntitled = 1;
video.entitlementUpdatedAt = item.createdAt;
updateVideo(video);
}
}
}
Aggregations