Search in sources :

Example 1 with UserData

use of org.musicbrainz.android.api.data.UserData in project musicbrainz-android by jdamcd.

the class ArtistLoader method getArtistWithUserData.

private AsyncEntityResult<Artist> getArtistWithUserData() throws IOException {
    Artist artist = client.lookupArtist(mbid);
    UserData userData = client.lookupUserData(Entity.ARTIST, mbid);
    data = new AsyncEntityResult<Artist>(LoaderStatus.SUCCESS, artist, userData);
    return data;
}
Also used : Artist(org.musicbrainz.android.api.data.Artist) UserData(org.musicbrainz.android.api.data.UserData)

Example 2 with UserData

use of org.musicbrainz.android.api.data.UserData in project musicbrainz-android by jdamcd.

the class MusicBrainzWebClient method lookupUserData.

@Override
public UserData lookupUserData(Entity entityType, String mbid) throws IOException {
    HttpEntity entity = get(QueryBuilder.userData(entityType, mbid));
    UserData userData = responseParser.parseUserData(entity.getContent());
    entity.consumeContent();
    return userData;
}
Also used : HttpEntity(org.apache.http.HttpEntity) UserData(org.musicbrainz.android.api.data.UserData)

Example 3 with UserData

use of org.musicbrainz.android.api.data.UserData in project musicbrainz-android by jdamcd.

the class ReleaseLoader method getReleaseWithUserData.

private AsyncEntityResult<Release> getReleaseWithUserData() throws IOException {
    Release release = client.lookupRelease(mbid);
    UserData userData = client.lookupUserData(Entity.RELEASE_GROUP, release.getReleaseGroupMbid());
    data = new AsyncEntityResult<Release>(LoaderStatus.SUCCESS, release, userData);
    return data;
}
Also used : UserData(org.musicbrainz.android.api.data.UserData) Release(org.musicbrainz.android.api.data.Release)

Example 4 with UserData

use of org.musicbrainz.android.api.data.UserData in project musicbrainz-android by jdamcd.

the class EditFragment method update.

@Override
public void update(Object entity) {
    if (App.isUserLoggedIn()) {
        UserData userData = getContract().getUserData();
        tagInput.setText(StringFormat.commaSeparate(userData.getTags()));
        ratingInput.setRating(userData.getRating());
    } else {
        disableEditViews();
        getView().findViewById(R.id.login_warning).setVisibility(View.VISIBLE);
    }
}
Also used : UserData(org.musicbrainz.android.api.data.UserData)

Example 5 with UserData

use of org.musicbrainz.android.api.data.UserData in project musicbrainz-android by jdamcd.

the class BarcodeReleaseLoader method getReleaseWithUserData.

private AsyncEntityResult<Release> getReleaseWithUserData() throws IOException {
    Release release = client.lookupReleaseUsingBarcode(barcode);
    UserData userData = client.lookupUserData(Entity.RELEASE_GROUP, release.getReleaseGroupMbid());
    data = new AsyncEntityResult<Release>(LoaderStatus.SUCCESS, release, userData);
    return data;
}
Also used : UserData(org.musicbrainz.android.api.data.UserData) Release(org.musicbrainz.android.api.data.Release)

Aggregations

UserData (org.musicbrainz.android.api.data.UserData)5 Release (org.musicbrainz.android.api.data.Release)2 HttpEntity (org.apache.http.HttpEntity)1 Artist (org.musicbrainz.android.api.data.Artist)1