diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index 9c905e772..e5d593a1a 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -124,14 +124,23 @@ public override IEnumerable GetItems() } var items = new List(); + var ignoredCount = 0; foreach (var torrent in torrents) { - if (torrent.Hash == null) + // Silently ignore torrents with no hash + if (torrent.Hash.IsNullOrWhiteSpace()) { continue; } + // Ignore torrents without a name, but track to log a single warning for all invalid torrents. + if (torrent.Name.IsNullOrWhiteSpace()) + { + ignoredCount++; + continue; + } + var item = new DownloadClientItem(); item.DownloadId = torrent.Hash.ToUpper(); item.Title = torrent.Name; @@ -189,6 +198,11 @@ public override IEnumerable GetItems() items.Add(item); } + if (ignoredCount > 0) + { + _logger.Warn("{0} torrent(s) were ignored becuase they did not have a title, check Deluge and remove any invalid torrents"); + } + return items; }