mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-21 23:33:00 +00:00
Fixed: Improve torrent blocklist matching
This commit is contained in:
parent
53f6f64448
commit
b8964f8bba
1 changed files with 11 additions and 13 deletions
|
@ -36,30 +36,28 @@ namespace NzbDrone.Core.Blocklisting
|
|||
|
||||
public bool Blocklisted(int seriesId, ReleaseInfo release)
|
||||
{
|
||||
var blocklistedByTitle = _blocklistRepository.BlocklistedByTitle(seriesId, release.Title);
|
||||
|
||||
if (release.DownloadProtocol == DownloadProtocol.Torrent)
|
||||
{
|
||||
var torrentInfo = release as TorrentInfo;
|
||||
|
||||
if (torrentInfo == null)
|
||||
if (release is not TorrentInfo torrentInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (torrentInfo.InfoHash.IsNullOrWhiteSpace())
|
||||
if (torrentInfo.InfoHash.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
return blocklistedByTitle.Where(b => b.Protocol == DownloadProtocol.Torrent)
|
||||
.Any(b => SameTorrent(b, torrentInfo));
|
||||
var blocklistedByTorrentInfohash = _blocklistRepository.BlocklistedByTorrentInfoHash(seriesId, torrentInfo.InfoHash);
|
||||
|
||||
return blocklistedByTorrentInfohash.Any(b => SameTorrent(b, torrentInfo));
|
||||
}
|
||||
|
||||
var blocklistedByTorrentInfohash = _blocklistRepository.BlocklistedByTorrentInfoHash(seriesId, torrentInfo.InfoHash);
|
||||
|
||||
return blocklistedByTorrentInfohash.Any(b => SameTorrent(b, torrentInfo));
|
||||
return _blocklistRepository.BlocklistedByTitle(seriesId, release.Title)
|
||||
.Where(b => b.Protocol == DownloadProtocol.Torrent)
|
||||
.Any(b => SameTorrent(b, torrentInfo));
|
||||
}
|
||||
|
||||
return blocklistedByTitle.Where(b => b.Protocol == DownloadProtocol.Usenet)
|
||||
.Any(b => SameNzb(b, release));
|
||||
return _blocklistRepository.BlocklistedByTitle(seriesId, release.Title)
|
||||
.Where(b => b.Protocol == DownloadProtocol.Usenet)
|
||||
.Any(b => SameNzb(b, release));
|
||||
}
|
||||
|
||||
public bool BlocklistedTorrentHash(int seriesId, string hash)
|
||||
|
|
Loading…
Reference in a new issue