From 7c5daa6000bb70f30552ecc2f4934f89253bcfa2 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 20 Sep 2017 19:09:18 -0700 Subject: [PATCH] Fixed: Long Deluge ETAs from breaking getting queue items --- .../Download/Clients/Deluge/Deluge.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index e97feb963..8e6ae9543 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Collections.Generic; using NzbDrone.Common.Disk; @@ -109,7 +109,17 @@ namespace NzbDrone.Core.Download.Clients.Deluge var outputPath = _remotePathMappingService.RemapRemoteToLocal(Settings.Host, new OsPath(torrent.DownloadPath)); item.OutputPath = outputPath + torrent.Name; item.RemainingSize = torrent.Size - torrent.BytesDownloaded; - item.RemainingTime = TimeSpan.FromSeconds(torrent.Eta); + + try + { + item.RemainingTime = TimeSpan.FromSeconds(torrent.Eta); + } + catch (OverflowException ex) + { + _logger.Debug(ex, "ETA for {0} is too long: {1}", torrent.Name, torrent.Eta); + item.RemainingTime = TimeSpan.MaxValue; + } + item.TotalSize = torrent.Size; if (torrent.State == DelugeTorrentStatus.Error)