From 68cf2eb4b52e04c1fe74b8f178ac189596abb812 Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Mon, 18 Mar 2013 16:34:49 +0100 Subject: [PATCH] Treat torrents with unknown eta as finishing in the far future rather than the far past. --- lib/src/org/transdroid/daemon/Torrent.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/src/org/transdroid/daemon/Torrent.java b/lib/src/org/transdroid/daemon/Torrent.java index 2d5ec2a9..63622186 100644 --- a/lib/src/org/transdroid/daemon/Torrent.java +++ b/lib/src/org/transdroid/daemon/Torrent.java @@ -139,14 +139,13 @@ public final class Torrent implements Parcelable, Comparable { if (realDateDone != null) { this.dateDone = realDateDone; } else { - Calendar cal = Calendar.getInstance(); if (eta == -1 || eta == -2) { - cal.clear(); - cal.set(1900, 12, 31); + this.dateDone = new Date(Long.MAX_VALUE); } else { + Calendar cal = Calendar.getInstance(); cal.add(Calendar.SECOND, eta); + this.dateDone = cal.getTime(); } - this.dateDone = cal.getTime(); } this.error = error; }