Пример #1
0
  public void addSubFolders() {
    if (client.getUser() == null) {
      return;
    }

    try {
      Playlists playlists = client.getUser().getPlaylists();
      playlists.load(false);

      for (Playlist playlist : playlists) {
        if (playlist.isVisible() && !YOUTUBE_DRIVE.contains(playlist.getSystemName())) {
          addChild(new AudioBoxPlaylist(client, playlist));
        }
      }
    } catch (Exception ex) {
      log.error("Error fetching tracks: ", ex);
    }
  }
Пример #2
0
  public AudioBoxRoot(String email, String password) {
    super("AudioBox.fm", null);
    String name = "AudioBox PS3";

    IConfiguration configuration = new DefaultConfiguration(name);
    configuration.setVersion(0, 1, 0);
    configuration.setRequestFormat(ContentFormat.JSON);
    configuration.setCacheManager(null);
    configuration.setUseCache(false);

    client = new AudioBox(configuration);

    try {
      client.login(email, password);
    } catch (Exception ex) {
      log.error("Error logging in: ", ex);
    }

    addSubFolders();
  }