use of com.zype.android.Db.Entity.PlaylistVideo in project zype-android by zype.
the class DbHelper method videoDataToPlaylistVideoEntity.
public static List<PlaylistVideo> videoDataToPlaylistVideoEntity(List<VideoData> videoData, String playlistId) {
List<PlaylistVideo> result = new ArrayList<>(videoData.size());
int number = 1;
for (VideoData item : videoData) {
PlaylistVideo entity = new PlaylistVideo();
entity.number = number;
entity.playlistId = playlistId;
entity.videoId = item.getId();
result.add(entity);
number++;
}
return result;
}
use of com.zype.android.Db.Entity.PlaylistVideo in project zype-android by zype.
the class DataRepository method insertPlaylistVideos.
public void insertPlaylistVideos(List<Video> videos, Playlist playlist) {
List<PlaylistVideo> playlistVideos = new ArrayList<>();
int number = db.zypeDao().getPlaylistVideosSync(playlist.id).size() + 1;
for (Video video : videos) {
PlaylistVideo playlistVideo = new PlaylistVideo();
playlistVideo.number = number;
playlistVideo.playlistId = playlist.id;
playlistVideo.videoId = video.id;
playlistVideos.add(playlistVideo);
number++;
}
db.zypeDao().insertPlaylistVideos(playlistVideos);
}
use of com.zype.android.Db.Entity.PlaylistVideo in project zype-android by zype.
the class DbHelper method videosToPlaylistVideos.
public static List<PlaylistVideo> videosToPlaylistVideos(List<Video> videos, String playlistId) {
List<PlaylistVideo> result = new ArrayList<>(videos.size());
int number = 1;
for (Video item : videos) {
PlaylistVideo entity = new PlaylistVideo();
entity.number = number;
entity.playlistId = playlistId;
entity.videoId = item.id;
result.add(entity);
number++;
}
return result;
}
Aggregations