1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-22 22:16:13 -04:00

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

Closes #6108
This commit is contained in:
Mark McDowall
2023-10-29 11:23:23 -07:00
committed by Mark McDowall
parent 5d86329c18
commit 3541cd7ba8
29 changed files with 176 additions and 53 deletions
@@ -15,6 +15,7 @@ namespace NzbDrone.Core.Blocklisting
public interface IBlocklistService
{
bool Blocklisted(int seriesId, ReleaseInfo release);
bool BlocklistedTorrentHash(int seriesId, string hash);
PagingSpec<Blocklist> Paged(PagingSpec<Blocklist> pagingSpec);
void Block(RemoteEpisode remoteEpisode, string message);
void Delete(int id);
@@ -61,6 +62,12 @@ namespace NzbDrone.Core.Blocklisting
.Any(b => SameNzb(b, release));
}
public bool BlocklistedTorrentHash(int seriesId, string hash)
{
return _blocklistRepository.BlocklistedByTorrentInfoHash(seriesId, hash).Any(b =>
b.TorrentInfoHash.Equals(hash, StringComparison.InvariantCultureIgnoreCase));
}
public PagingSpec<Blocklist> Paged(PagingSpec<Blocklist> pagingSpec)
{
return _blocklistRepository.GetPaged(pagingSpec);