From d602f38b7d1fc7e09f4d74a8fd245928f8e0e811 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 25 Jun 2024 15:52:12 -0700 Subject: [PATCH] New: Ignore Deluge torrents without a title (cherry picked from commit a0d29331341320268552660658b949179c963793) --- .../Download/Clients/Deluge/Deluge.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index 9cbf3c4ca..faaff7112 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -122,14 +122,23 @@ namespace NzbDrone.Core.Download.Clients.Deluge } 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; @@ -187,6 +196,11 @@ namespace NzbDrone.Core.Download.Clients.Deluge 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; }