Skip to content

Commit

Permalink
Fixed TorrentStatus with new API.
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 26, 2015
1 parent 39fd557 commit 6b702a2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
20 changes: 20 additions & 0 deletions src/com/frostwire/jlibtorrent/PosixTimeDuration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.frostwire.jlibtorrent;

import com.frostwire.jlibtorrent.swig.posix_time_duration;

/**
* @author gubatron
* @author aldenml
*/
public final class PosixTimeDuration {

private final posix_time_duration td;

public PosixTimeDuration(posix_time_duration td) {
this.td = td;
}

public posix_time_duration getSwig() {
return td;
}
}
23 changes: 9 additions & 14 deletions src/com/frostwire/jlibtorrent/TorrentStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,27 @@ public String getName() {
*
* @return
*/
public TorrentInfo getTorrentFile() {
return new TorrentInfo(ts.getTorrent_file());
}
// public TorrentInfo getTorrentFile() {
// return new TorrentInfo(ts.getTorrent_file());
// }

/**
* The time until the torrent will announce itself to the tracker.
*
* @return
*/
public TimeDuration getNextAnnounce() {
return new TimeDuration(ts.getNext_announce());
public PosixTimeDuration getNextAnnounce() {
return new PosixTimeDuration(ts.getNext_announce());
}

/**
* The time the tracker want us to wait until we announce ourself
* The time the tracker want us to wait until we announce our self
* again the next time.
*
* @return
*/
public TimeDuration getAnnounceInterval() {
return new TimeDuration(ts.getAnnounce_interval());
public PosixTimeDuration getAnnounceInterval() {
return new PosixTimeDuration(ts.getAnnounce_interval());
}

/**
Expand Down Expand Up @@ -682,12 +682,7 @@ private static long time2millis(int time) {
*/
public enum State {

/**
* The torrent is in the queue for being checked. But there
* currently is another torrent that are being checked.
* This torrent will wait for its turn.
*/
QUEUED_FOR_CHECKING(torrent_status.state_t.queued_for_checking.swigValue()),
UNUSED_ENUM_FOR_BACKWARDS_COMPATIBILITY(torrent_status.state_t.unused_enum_for_backwards_compatibility.swigValue()),

/**
* The torrent has not started its download yet, and is
Expand Down

0 comments on commit 6b702a2

Please sign in to comment.