Examples of ArtistTopTracksParser


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

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

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

  @Before
  public void loadFunctionDependencyAndTestdata() throws ApplicationException {
    PostgreSQLUtil.loadFunction(dao, UPDATE_ARTISTTOPTRACK);

    ArtistTopTracksParser cherParser = new ArtistTopTracksParserImpl(
        new ResourceUtil(CHER_TOP_TRACKS).getInputStream());
    ArtistTopTracksParser rihannaParser = new ArtistTopTracksParserImpl(
        new ResourceUtil(RIHANNA_TOP_TRACKS).getInputStream());
    cherArtist = cherParser.getArtist();
    rihannaArtist = rihannaParser.getArtist();
    cherTopTracks = cherParser.getTopTracks();
    rihannaTopTracks = rihannaParser.getTopTracks();

    PostgreSQLUtil.truncateTables(dao);
  }
View Full Code Here

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

    for (String artistName : artistNames) {
      try {
        WSResponse wsResponse = artistTopTracksClient.getTopTracks(new Artist(artistName));
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          ArtistTopTracksParser attParser =
            new ArtistTopTracksParserImpl(stringUtil.getInputStream());
          artistTopTracksDao.createTopTracks(attParser.getArtist(),
              attParser.getTopTracks());
        }
      } catch (ApplicationException e) {
        LOG.warn("Fetching top tracks for " + artistName + " failed.", e);
      }
      addFinishedOperation();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.