mirror of https://github.com/lidarr/Lidarr
parent
30833453a6
commit
29f1e63955
|
@ -37,30 +37,28 @@ namespace NzbDrone.Core.Blocklisting
|
||||||
|
|
||||||
public bool Blocklisted(int artistId, ReleaseInfo release)
|
public bool Blocklisted(int artistId, ReleaseInfo release)
|
||||||
{
|
{
|
||||||
var blocklistedByTitle = _blocklistRepository.BlocklistedByTitle(artistId, release.Title);
|
|
||||||
|
|
||||||
if (release.DownloadProtocol == DownloadProtocol.Torrent)
|
if (release.DownloadProtocol == DownloadProtocol.Torrent)
|
||||||
{
|
{
|
||||||
var torrentInfo = release as TorrentInfo;
|
if (release is not TorrentInfo torrentInfo)
|
||||||
|
|
||||||
if (torrentInfo == null)
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (torrentInfo.InfoHash.IsNullOrWhiteSpace())
|
if (torrentInfo.InfoHash.IsNotNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
return blocklistedByTitle.Where(b => b.Protocol == DownloadProtocol.Torrent)
|
var blocklistedByTorrentInfohash = _blocklistRepository.BlocklistedByTorrentInfoHash(artistId, torrentInfo.InfoHash);
|
||||||
.Any(b => SameTorrent(b, torrentInfo));
|
|
||||||
|
return blocklistedByTorrentInfohash.Any(b => SameTorrent(b, torrentInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
var blocklistedByTorrentInfohash = _blocklistRepository.BlocklistedByTorrentInfoHash(artistId, torrentInfo.InfoHash);
|
return _blocklistRepository.BlocklistedByTitle(artistId, release.Title)
|
||||||
|
.Where(b => b.Protocol == DownloadProtocol.Torrent)
|
||||||
return blocklistedByTorrentInfohash.Any(b => SameTorrent(b, torrentInfo));
|
.Any(b => SameTorrent(b, torrentInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
return blocklistedByTitle.Where(b => b.Protocol == DownloadProtocol.Usenet)
|
return _blocklistRepository.BlocklistedByTitle(artistId, release.Title)
|
||||||
.Any(b => SameNzb(b, release));
|
.Where(b => b.Protocol == DownloadProtocol.Usenet)
|
||||||
|
.Any(b => SameNzb(b, release));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool BlocklistedTorrentHash(int artistId, string hash)
|
public bool BlocklistedTorrentHash(int artistId, string hash)
|
||||||
|
|
Loading…
Reference in New Issue