Skip to content

Commit

Permalink
Removed TorrentPrioritizeAlert.
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Jan 5, 2016
1 parent c57dc76 commit 770d203
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 54 deletions.
5 changes: 1 addition & 4 deletions src/main/java/com/frostwire/jlibtorrent/Downloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.frostwire.jlibtorrent.alerts.Alert;
import com.frostwire.jlibtorrent.alerts.AlertType;
import com.frostwire.jlibtorrent.alerts.MetadataReceivedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentPrioritizeAlert;
import com.frostwire.jlibtorrent.swig.*;

import java.io.File;
Expand All @@ -18,7 +17,7 @@
*/
public final class Downloader {

private static final int[] LISTENER_TYPES = new int[] { AlertType.METADATA_RECEIVED.getSwig() };
private static final int[] LISTENER_TYPES = new int[]{AlertType.METADATA_RECEIVED.getSwig()};

private final Session s;

Expand Down Expand Up @@ -46,12 +45,10 @@ public void download(TorrentInfo ti, File saveDir, Priority[] priorities, File r
}

th.prioritizeFiles(priorities);
s.fireAlert(new TorrentPrioritizeAlert(th));
} else {
// did they just add the entire torrent (therefore not selecting any priorities)
final Priority[] wholeTorrentPriorities = Priority.array(Priority.NORMAL, ti.getNumFiles());
th.prioritizeFiles(wholeTorrentPriorities);
s.fireAlert(new TorrentPrioritizeAlert(th));
}
} else { // new download
s.asyncAddTorrent(ti, saveDir, priorities, resumeFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ public void incomingRequest(IncomingRequestAlert alert) {
public void pickerLog(PickerLogAlert alert) {
}

public void torrentPrioritize(TorrentPrioritizeAlert alert) {
}

private static InvokeLambda[] buildTable() {
InvokeLambda[] arr = new InvokeLambda[libtorrent.num_alert_types];

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/frostwire/jlibtorrent/alerts/AlertType.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public enum AlertType {
DHT_GET_PEERS_REPLY(dht_get_peers_reply_alert.alert_type),
DHT_DIRECT_RESPONSE(dht_direct_response_alert.alert_type),
PICKER_LOG(picker_log_alert.alert_type),
UNKNOWN(-1),
TORRENT_PRIORITIZE(-2);
UNKNOWN(-1);

private static AlertType[] TABLE = buildTable();

Expand Down Expand Up @@ -208,7 +207,7 @@ private static AlertType[] buildTable() {
arr[87] = DHT_GET_PEERS_REPLY;
arr[88] = DHT_DIRECT_RESPONSE;
arr[89] = PICKER_LOG;

return arr;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import com.frostwire.jlibtorrent.alerts.TorrentErrorAlert;
import com.frostwire.jlibtorrent.alerts.TorrentFinishedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentPausedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentPrioritizeAlert;
import com.frostwire.jlibtorrent.alerts.TorrentRemovedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentResumedAlert;
import com.frostwire.jlibtorrent.alerts.TorrentUpdateAlert;
Expand Down Expand Up @@ -384,11 +383,6 @@ public void scrapeReply(ScrapeReplyAlert alert) {
System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
}

@Override
public void torrentPrioritize(TorrentPrioritizeAlert alert) {
System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
}

@Override
public void unwantedBlock(UnwantedBlockAlert alert) {
System.out.println(alert.getType() + " - " + alert.getSwig().what() + " - " + alert.getSwig().message());
Expand Down

0 comments on commit 770d203

Please sign in to comment.