mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-23 08:15:27 +00:00
parent
4c622fd412
commit
a0d2933134
1 changed files with 15 additions and 1 deletions
|
@ -124,14 +124,23 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||||
}
|
}
|
||||||
|
|
||||||
var items = new List<DownloadClientItem>();
|
var items = new List<DownloadClientItem>();
|
||||||
|
var ignoredCount = 0;
|
||||||
|
|
||||||
foreach (var torrent in torrents)
|
foreach (var torrent in torrents)
|
||||||
{
|
{
|
||||||
if (torrent.Hash == null)
|
// Silently ignore torrents with no hash
|
||||||
|
if (torrent.Hash.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
continue;
|
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();
|
var item = new DownloadClientItem();
|
||||||
item.DownloadId = torrent.Hash.ToUpper();
|
item.DownloadId = torrent.Hash.ToUpper();
|
||||||
item.Title = torrent.Name;
|
item.Title = torrent.Name;
|
||||||
|
@ -189,6 +198,11 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||||
items.Add(item);
|
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;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue