Package com.github.hakko.musiccabinet.parser.musicbrainz

Examples of com.github.hakko.musiccabinet.parser.musicbrainz.ReleaseParser


  }
 
  protected void updateArtistDiscographies() {
    List<MBArtist> outdatedArtists = artistDao.getOutdatedArtists();
    List<MBRelease> mbReleases = new ArrayList<>();
    ReleaseParser parser;
    discographies = outdatedArtists.size();
    for (MBArtist artist : outdatedArtists) {
      try {
        int offset = 0;
        do {
          StringUtil response = new StringUtil(releaseClient.get(
            artist.getName(), artist.getMbid(), offset));
          parser = new ReleaseParserImpl(response.getInputStream());
          for (MBRelease album : parser.getReleases()) {
            album.setArtistId(artist.getId());
          }
          mbReleases.addAll(parser.getReleases());
          offset += 100;
        } while (offset < parser.getTotalReleases());
        ++discography;
        if (mbReleases.size() > 1000) {
          albumDao.createAlbums(mbReleases);
          mbReleases.clear();
        }
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.parser.musicbrainz.ReleaseParser

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.