client_factory.getProfileView().startLoading();
// sistemo subito il rating visivo poi arrivera' la library aggiornata
client_factory.getProfileView().setRating(rate);
client_factory.getProfileView().showStar(rate);
SongSummaryDTO new_song_dto = new SongSummaryDTO(artist, title, album);
song_service_svc.rateSong(current_user.getUser(), new_song_dto, rate,
new AsyncCallback<Double>() {
@Override
public void onFailure(Throwable caught) {
client_factory.getProfileView().showError(
my_constants.rateSongError());
client_factory.getProfileView().stopLoading();
}
@Override
public void onSuccess(Double result) {
Map<String, SongSummaryDTO> songs = current_user
.getMusicLibrary().getSongs();
SongSummaryDTO song = songs.get(FieldVerifier
.generateSongId(title, artist, album));
song.setRatingForThisUser(rate);
song.setRating(result);
client_factory.getProfileView().showGlobalStar(result);
// Ricalcolo delle statistiche relative al rating delle
// canzoni del catalogo
List<String> song_statistics = calculateSongStatistics(current_user