Fixed: Blocklisting torrents from indexers that do not provide torrent hash

(cherry picked from commit 3541cd7ba877fb785c7f97123745abf51162eb8e)

Closes #3082
This commit is contained in:
Mark McDowall
2023-10-29 11:23:23 -07:00
committed by Bogdan
parent 526429bde4
commit 2351efd013
24 changed files with 164 additions and 45 deletions
@@ -15,6 +15,7 @@ namespace NzbDrone.Core.Blocklisting
public interface IBlocklistService
{
bool Blocklisted(int authorId, ReleaseInfo release);
bool BlocklistedTorrentHash(int authorId, string hash);
PagingSpec<Blocklist> Paged(PagingSpec<Blocklist> pagingSpec);
void Block(RemoteBook remoteEpisode, string message);
void Delete(int id);
@@ -62,6 +63,12 @@ namespace NzbDrone.Core.Blocklisting
.Any(b => SameNzb(b, release));
}
public bool BlocklistedTorrentHash(int authorId, string hash)
{
return _blocklistRepository.BlocklistedByTorrentInfoHash(authorId, hash).Any(b =>
b.TorrentInfoHash.Equals(hash, StringComparison.InvariantCultureIgnoreCase));
}
public PagingSpec<Blocklist> Paged(PagingSpec<Blocklist> pagingSpec)
{
return _blocklistRepository.GetPaged(pagingSpec);