Package com.github.hakko.musiccabinet.ws.lastfm

Examples of com.github.hakko.musiccabinet.ws.lastfm.WSResponse.wasCallAllowed()


    for (LastFmUser user : users) {
      short page = 0, totalPages = 0;
      List<Track> lovedTracks = new ArrayList<>();
      do {
        WSResponse wsResponse = userLovedTracksClient.getUserLovedTracks(user, page);
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          UserLovedTracksParser parser = new UserLovedTracksParserImpl(
              stringUtil.getInputStream());
          totalPages = parser.getTotalPages();
          lovedTracks.addAll(parser.getLovedTracks());
View Full Code Here


    setTotalOperations(artistNames.size());
   
    for (String artistName : artistNames) {
      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());
View Full Code Here

    setTotalOperations(tags.size());
   
    for (Tag tag : tags) {
      try {
        WSResponse wsResponse = tagTopArtistsClient.getTopArtists(tag);
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          TagTopArtistsParser parser =
              new TagTopArtistsParserImpl(stringUtil.getInputStream());
          topArtists.add(new TagTopArtists(tag.getName(), parser.getArtists()));
        }
View Full Code Here

   
    for (String artistName : artistNames) {
      try {
        WSResponse wsResponse = artistInfoClient.getArtistInfo(
            new Artist(artistName), lastFmSettingsService.getLang());
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          ArtistInfoParser aiParser =
            new ArtistInfoParserImpl(stringUtil.getInputStream());
          if (aiParser.getArtistInfo() != null) {
            artistInfos.add(aiParser.getArtistInfo());
View Full Code Here

   
    for (LastFmUser user : users) {
      for (Period period : Period.values()) {
        try {
          WSResponse wsResponse = userTopArtistsClient.getUserTopArtists(user, period);
          if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
            StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
            UserTopArtistsParser parser =
                new UserTopArtistsParserImpl(stringUtil.getInputStream());
            userTopArtists.add(new UserTopArtists(user, period, parser.getArtists()));
          }
View Full Code Here

    setTotalOperations(artistNames.size());
   
    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());
View Full Code Here

    for (LastFmUser user : users) {
      try {
        WSResponse wsResponse = userRecommendedArtistsClient.
            getUserRecommendedArtists(user.getLastFmUsername());
        LOG.debug(wsResponse);
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          UserRecommendedArtistsParser parser =
              new UserRecommendedArtistsParserImpl(stringUtil.getInputStream());
          artists.add(new UserRecommendedArtists(user, parser.getArtists()));
        }
View Full Code Here

    setTotalOperations(groups.size());
   
    for (LastFmGroup group : groups) {
      try {
        WSResponse wsResponse = client.getWeeklyArtistChart(group);
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          GroupWeeklyArtistChartParser parser =
              new GroupWeeklyArtistChartParserImpl(stringUtil.getInputStream());
          artistCharts.add(new GroupWeeklyArtistChart(
              group.getName(), parser.getArtistPlayCount()));
View Full Code Here

    setTotalOperations(albums.size());
   
    for (Album album : albums) {
      try {
        WSResponse wsResponse = albumInfoClient.getAlbumInfo(album);
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          AlbumInfoParser aiParser =
            new AlbumInfoParserImpl(stringUtil.getInputStream());
          albumInfos.add(aiParser.getAlbumInfo());
         
View Full Code Here

    setTotalOperations(artistNames.size());
   
    for (String artistName : artistNames) {
      try {
        WSResponse wsResponse = artistTopTagsClient.getTopTags(new Artist(artistName));
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          ArtistTopTagsParser attParser =
            new ArtistTopTagsParserImpl(stringUtil.getInputStream());
          removeTagsWithLowTagCount(attParser.getTopTags());
          artistTopTagsDao.createTopTags(attParser.getArtist(),
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.