mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-29 03:05:49 +00:00
Fixed: Long Deluge ETAs from breaking getting queue items
This commit is contained in:
parent
ea7d7d0a14
commit
7c5daa6000
1 changed files with 12 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
|
@ -109,7 +109,17 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||||
var outputPath = _remotePathMappingService.RemapRemoteToLocal(Settings.Host, new OsPath(torrent.DownloadPath));
|
var outputPath = _remotePathMappingService.RemapRemoteToLocal(Settings.Host, new OsPath(torrent.DownloadPath));
|
||||||
item.OutputPath = outputPath + torrent.Name;
|
item.OutputPath = outputPath + torrent.Name;
|
||||||
item.RemainingSize = torrent.Size - torrent.BytesDownloaded;
|
item.RemainingSize = torrent.Size - torrent.BytesDownloaded;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
item.RemainingTime = TimeSpan.FromSeconds(torrent.Eta);
|
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;
|
item.TotalSize = torrent.Size;
|
||||||
|
|
||||||
if (torrent.State == DelugeTorrentStatus.Error)
|
if (torrent.State == DelugeTorrentStatus.Error)
|
||||||
|
|
Loading…
Reference in a new issue