Browse Source

Treat torrents with unknown eta as finishing in the far future rather than the far past.

pull/11/head
Eric Kok 12 years ago
parent
commit
68cf2eb4b5
  1. 7
      lib/src/org/transdroid/daemon/Torrent.java

7
lib/src/org/transdroid/daemon/Torrent.java

@ -139,15 +139,14 @@ public final class Torrent implements Parcelable, Comparable<Torrent> {
if (realDateDone != null) { if (realDateDone != null) {
this.dateDone = realDateDone; this.dateDone = realDateDone;
} else { } else {
Calendar cal = Calendar.getInstance();
if (eta == -1 || eta == -2) { if (eta == -1 || eta == -2) {
cal.clear(); this.dateDone = new Date(Long.MAX_VALUE);
cal.set(1900, 12, 31);
} else { } else {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.SECOND, eta); cal.add(Calendar.SECOND, eta);
}
this.dateDone = cal.getTime(); this.dateDone = cal.getTime();
} }
}
this.error = error; this.error = error;
} }

Loading…
Cancel
Save