diff --git a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
index 5832ba9a4..c7085eb48 100644
--- a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
+++ b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
@@ -98,6 +98,7 @@
+
diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs
index 56ff9f315..664809cdc 100644
--- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs
+++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs
@@ -107,7 +107,7 @@ public override IEnumerable GetItems()
item.TotalSize = torrent.Size;
item.DownloadClient = Definition.Name;
item.RemainingSize = (long)(torrent.Size * (1.0 - torrent.Progress));
- item.RemainingTime = TimeSpan.FromSeconds(torrent.Eta);
+ item.RemainingTime = GetRemainingTime(torrent);
item.OutputPath = _remotePathMappingService.RemapRemoteToLocal(Settings.Host, new OsPath(torrent.SavePath));
@@ -333,5 +333,15 @@ private void SetInitialState(string hash)
_logger.Warn(ex, "Failed to set inital state for {0}.", hash);
}
}
+
+ protected TimeSpan? GetRemainingTime(QBittorrentTorrent torrent)
+ {
+ if (torrent.Eta < 0 || torrent.Eta > 365 * 24 * 3600)
+ {
+ return null;
+ }
+
+ return TimeSpan.FromSeconds((int)torrent.Eta);
+ }
}
}
diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentTorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentTorrent.cs
index 266d22f95..d5fa0b5e7 100644
--- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentTorrent.cs
+++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentTorrent.cs
@@ -1,4 +1,5 @@
-using Newtonsoft.Json;
+using System.Numerics;
+using Newtonsoft.Json;
namespace NzbDrone.Core.Download.Clients.QBittorrent
{
@@ -13,7 +14,7 @@ public class QBittorrentTorrent
public double Progress { get; set; } // Torrent progress (%/100)
- public ulong Eta { get; set; } // Torrent ETA (seconds)
+ public BigInteger Eta { get; set; } // Torrent ETA (seconds) (QBit contains a bug exceeding ulong limits)
public string State { get; set; } // Torrent state. See possible values here below
diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj
index 555710344..e278fa376 100644
--- a/src/NzbDrone.Core/NzbDrone.Core.csproj
+++ b/src/NzbDrone.Core/NzbDrone.Core.csproj
@@ -98,6 +98,7 @@
+