Package com.github.hakko.musiccabinet.parser.lastfm

Examples of com.github.hakko.musiccabinet.parser.lastfm.ArtistSimilarityParserImpl


   
    Assert.assertNotNull(ts);
  }
 
  private int prepareTestdataForArtist() throws ApplicationException {
    ArtistSimilarityParser asParser = new ArtistSimilarityParserImpl(
        new ResourceUtil(CHER_SIMILAR_ARTISTS).getInputStream());
    artistRelationDao.createArtistRelations(
        asParser.getArtist(), asParser.getArtistRelations());

    ArtistTopTracksParser attParser = new ArtistTopTracksParserImpl(
        new ResourceUtil(CHER_TOP_TRACKS).getInputStream());
    artistTopTracksDao.createTopTracks(
        attParser.getArtist(), attParser.getTopTracks());
   
    List<File> files = new ArrayList<>();
    for (Track topTrack : attParser.getTopTracks()) {
      files.add(UnittestLibraryUtil.getFile(topTrack));
    }
    UnittestLibraryUtil.submitFile(additionDao, files);

    int artistId = musicDao.getArtistId(asParser.getArtist());
   
    playlistGeneratorDao.updateSearchIndex();

    return artistId;
  }
View Full Code Here


      try {
        WSResponse wsResponse = artistSimilarityClient.getArtistSimilarity(new Artist(artistName));
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          ArtistSimilarityParser asParser =
            new ArtistSimilarityParserImpl(stringUtil.getInputStream());
          artistRelationDao.createArtistRelations(asParser.getArtist(),
              asParser.getArtistRelations());
        }
      } catch (ApplicationException e) {
        LOG.warn("Fetching artist relations for " + artistName + " failed.", e);
      }
      addFinishedOperation();
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.parser.lastfm.ArtistSimilarityParserImpl

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.