예제 #1
0
  /**
   * @param torrent
   * @param maxDelayMS TODO
   */
  public static void updateMetaData(final TOTorrent torrent, long maxDelayMS) {
    if (!isContent(torrent, true)) {
      log(torrent, "torrent " + new String(torrent.getName()) + " not az content");
      return;
    }

    log(torrent, "updateMD");

    PlatformTorrentMessenger.getMetaData(
        new TOTorrent[] {torrent},
        maxDelayMS,
        new PlatformTorrentMessenger.GetMetaDataReplyListener() {

          public void messageSent() {}

          public void replyReceived(String replyType, Map mapHashes) {
            updateMetaData_handleReply(torrent, null, replyType, mapHashes);
          }
        });
  }
예제 #2
0
  /**
   * @param torrent
   * @param maxDelayMS TODO
   */
  public static void updateMetaData(final TOTorrent[] torrents, long maxDelayMS) {
    if (torrents == null) {
      log("no torrents to update MD on");
      return;
    }

    log("update " + torrents.length + " MD");

    PlatformTorrentMessenger.getMetaData(
        torrents,
        maxDelayMS,
        new PlatformTorrentMessenger.GetMetaDataReplyListener() {

          public void messageSent() {}

          public void replyReceived(String replyType, Map mapHashes) {
            for (Iterator iter = mapHashes.keySet().iterator(); iter.hasNext(); ) {
              String hash = (String) iter.next();
              updateMetaData_handleReply(null, hash, replyType, mapHashes);
            }
          }
        });
  }