use of net.robinfriedli.aiode.entities.Episode in project aiode by robinfriedli.
the class HibernatePlaylistMigrator method loadSpotifyItem.
private void loadSpotifyItem(XmlElement item, int index, SpotifyTrackBulkLoadingService spotifyBulkLoadingService, ShardManager shardManager, Playlist newPlaylist, Map<PlaylistItem, Integer> itemsWithIndex, SpotifyTrackKind kind) {
String id = item.getAttribute("id").getValue();
spotifyBulkLoadingService.add(createItem(id, kind), spotifyTrack -> {
String addedUser = item.getAttribute("addedUser").getValue();
String addedUserId = item.getAttribute("addedUserId").getValue();
PlaylistItem playlistItem = spotifyTrack.exhaustiveMatch(track -> new Song(track, addedUser, addedUserId, newPlaylist, session), episode -> new Episode(episode, addedUser, addedUserId, newPlaylist));
playlistItem.setAddedUser(item.getAttribute("addedUser").getValue());
playlistItem.setAddedUserId(item.getAttribute("addedUserId").getValue());
itemsWithIndex.put(playlistItem, index);
});
}
Aggregations