mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-05 15:47:20 +02:00
parent
1d8cf6a7f5
commit
58b726a292
@ -38,30 +38,28 @@ public BlocklistService(IBlocklistRepository blocklistRepository)
|
|||||||
|
|
||||||
public bool Blocklisted(int movieId, ReleaseInfo release)
|
public bool Blocklisted(int movieId, ReleaseInfo release)
|
||||||
{
|
{
|
||||||
var blocklistedByTitle = _blocklistRepository.BlocklistedByTitle(movieId, 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(movieId, torrentInfo.InfoHash);
|
||||||
.Any(b => SameTorrent(b, torrentInfo));
|
|
||||||
|
return blocklistedByTorrentInfohash.Any(b => SameTorrent(b, torrentInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
var blocklistedByTorrentInfohash = _blocklistRepository.BlocklistedByTorrentInfoHash(movieId, torrentInfo.InfoHash);
|
return _blocklistRepository.BlocklistedByTitle(movieId, 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(movieId, release.Title)
|
||||||
.Any(b => SameNzb(b, release));
|
.Where(b => b.Protocol == DownloadProtocol.Usenet)
|
||||||
|
.Any(b => SameNzb(b, release));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool BlocklistedTorrentHash(int movieId, string hash)
|
public bool BlocklistedTorrentHash(int movieId, string hash)
|
||||||
|
Loading…
Reference in New Issue
Block a user