public Set<Song> call() throws Exception {
bus.post(new GetSongsToSyncStartedEvent(this));
bus.post(new GetSongsToSyncProgressChangedEvent(this, 0, 3));
User user = client.login(username, password);
bus.post(new GetSongsToSyncProgressChangedEvent(this, 1, 3));
// The library.get() response contains favorited songs that do not have
// the 'favorited' property set. To work around this, favorites are
// removed from the library set and replaced with instances from the
// favorites set. The result is that all songs within the resulting set
// are 'collected', and some are 'favorited'.
ImmutableSet<Song> library = ImmutableSet.copyOf(user.library().get());
bus.post(new GetSongsToSyncProgressChangedEvent(this, 2, 3));
ImmutableSet<Song> favorites = ImmutableSet.copyOf(user.favorites().get());
SetView<Song> nonFavorites = Sets.difference(library, favorites);
SetView<Song> all = Sets.union(nonFavorites, favorites);
bus.post(new GetSongsToSyncProgressChangedEvent(this, 3, 3));