Package co.arcs.groove.thresher

Examples of co.arcs.groove.thresher.User$Favorites


    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));
View Full Code Here

TOP

Related Classes of co.arcs.groove.thresher.User$Favorites

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.