use of se.light.assembly64.model.PlaylistChecksum in project assembly64fx by freabemania.
the class PlaylistService method mergePlaylists.
private void mergePlaylists() {
PlaylistChecksum serverChecksums = getChecksumsFromServer();
// get local list
List<PlaylistInfo> localPlayListInfo = getLocalPlaylistInfo();
long localPlaylistChksum = Support.getChksumPInfo(localPlayListInfo, false);
// get local public list
List<PlaylistInfo> localPublicPlayListInfo = getLocalPublicPlaylistInfo();
long localPublicPlaylistChksum = Support.getChksumPInfo(localPublicPlayListInfo, true);
if (!serverChecksums.getPrivateList().equals(localPlaylistChksum)) {
List<PlaylistInfo> playlistInfo = getPlaylistInfo();
playlists = playlistInfo;
flushPlaylistInfo(false, playlistInfo);
LOGGER.info("Refreshed and flushed private playlist");
} else {
playlists = localPlayListInfo;
LOGGER.info("Resolved local playlist with ok checksum");
}
if (!serverChecksums.getPublicList().equals(localPublicPlaylistChksum)) {
List<PlaylistInfo> remotePublicPlayListInfo = getPublicPlaylists();
flushPublicPlaylistInfo(remotePublicPlayListInfo);
LOGGER.info("Refreshed and flushed public playlist");
} else {
publicPlaylists = localPublicPlayListInfo;
LOGGER.info("Resolved public playlist with ok checksum");
}
}
Aggregations