Search in sources :

Example 6 with Tag

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

the class MusicBrainzWebClient method lookupTags.

@Override
public LinkedList<Tag> lookupTags(Entity type, String mbid) throws IOException {
    HttpEntity entity = get(QueryBuilder.tagLookup(type, mbid));
    LinkedList<Tag> tags = responseParser.parseTagLookup(entity.getContent());
    entity.consumeContent();
    Collections.sort(tags);
    return tags;
}
Also used : HttpEntity(org.apache.http.HttpEntity) Tag(org.musicbrainz.android.api.data.Tag)

Example 7 with Tag

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

the class ArtistLookupHandler method startElement.

public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    if (localName.equals("artist") && !inArtistRelations) {
        artist.setMbid(atts.getValue("id"));
        artist.setType(atts.getValue("type"));
    } else if (localName.equals("name")) {
        buildString();
    } else if (localName.equals("tag")) {
        inTag = true;
        buildString();
        tag = new Tag();
        tag.setCount(Integer.parseInt(atts.getValue("count")));
    } else if (localName.equals("rating")) {
        artist.setRatingCount(Integer.parseInt(atts.getValue("votes-count")));
        buildString();
    } else if (localName.equals("country")) {
        buildString();
    } else if (localName.equals("relation") && inUrlRelations) {
        buildString();
        link = new WebLink();
        link.setType(atts.getValue("type"));
    } else if (localName.equals("target")) {
        buildString();
    } else if (localName.equals("life-span")) {
        inLifeSpan = true;
    } else if (localName.equals("begin")) {
        buildString();
    } else if (localName.equals("end")) {
        buildString();
    } else if (localName.equals("relation-list")) {
        setRelationStatus(atts.getValue("target-type"));
    } else if (inUnsupported(localName)) {
        inUnsupported = true;
    }
}
Also used : Tag(org.musicbrainz.android.api.data.Tag) WebLink(org.musicbrainz.android.api.data.WebLink)

Example 8 with Tag

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

the class LabelLookupHandler method startElement.

public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    if (localName.equals("label")) {
        label.setMbid(atts.getValue("id"));
    } else if (localName.equals("name") && !inTag) {
        buildString();
    } else if (localName.equals("tag")) {
        inTag = true;
        tag = new Tag();
        tag.setCount(Integer.parseInt(atts.getValue("count")));
    } else if (localName.equals("rating")) {
        label.setRatingCount(Integer.parseInt(atts.getValue("votes-count")));
        buildString();
    } else if (localName.equals("country")) {
        buildString();
    } else if (localName.equals("begin")) {
        buildString();
    } else if (localName.equals("end")) {
        buildString();
    } else if (localName.equals("relation-list")) {
        if (atts.getValue("target-type").equals("url")) {
            inUrlRelations = true;
        }
    } else if (localName.equals("relation") && inUrlRelations) {
        buildString();
        link = new WebLink();
        link.setType(atts.getValue("type"));
    }
}
Also used : Tag(org.musicbrainz.android.api.data.Tag) WebLink(org.musicbrainz.android.api.data.WebLink)

Aggregations

Tag (org.musicbrainz.android.api.data.Tag)8 ReleaseArtist (org.musicbrainz.android.api.data.ReleaseArtist)3 WebLink (org.musicbrainz.android.api.data.WebLink)3 InputStream (java.io.InputStream)1 HttpEntity (org.apache.http.HttpEntity)1 Track (org.musicbrainz.android.api.data.Track)1 ResponseParser (org.musicbrainz.android.api.webservice.ResponseParser)1