mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-21 22:05:43 -04:00
Fixed: Blocklisting pending releases
Closes #4598 (cherry picked from commit 3f60e28c42d946691c4d44eb391b7888466538d9)
This commit is contained in:
committed by
Robin Dadswell
parent
a219b4a1b8
commit
86da4e87ea
@@ -17,6 +17,7 @@ namespace NzbDrone.Core.Blocklisting
|
||||
bool Blocklisted(int movieId, ReleaseInfo release);
|
||||
PagingSpec<Blocklist> Paged(PagingSpec<Blocklist> pagingSpec);
|
||||
List<Blocklist> GetByMovieId(int movieId);
|
||||
void Block(RemoteMovie remoteMovie, string message);
|
||||
void Delete(int id);
|
||||
void Delete(List<int> ids);
|
||||
}
|
||||
@@ -72,6 +73,29 @@ namespace NzbDrone.Core.Blocklisting
|
||||
return _blocklistRepository.BlocklistedByMovie(movieId);
|
||||
}
|
||||
|
||||
public void Block(RemoteMovie remoteMovie, string message)
|
||||
{
|
||||
var blocklist = new Blocklist
|
||||
{
|
||||
MovieId = remoteMovie.Movie.Id,
|
||||
SourceTitle = remoteMovie.Release.Title,
|
||||
Quality = remoteMovie.ParsedMovieInfo.Quality,
|
||||
Date = DateTime.UtcNow,
|
||||
PublishedDate = remoteMovie.Release.PublishDate,
|
||||
Size = remoteMovie.Release.Size,
|
||||
Indexer = remoteMovie.Release.Indexer,
|
||||
Protocol = remoteMovie.Release.DownloadProtocol,
|
||||
Message = message
|
||||
};
|
||||
|
||||
if (remoteMovie.Release is TorrentInfo torrentRelease)
|
||||
{
|
||||
blocklist.TorrentInfoHash = torrentRelease.InfoHash;
|
||||
}
|
||||
|
||||
_blocklistRepository.Insert(blocklist);
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
{
|
||||
_blocklistRepository.Delete(id);
|
||||
|
||||
Reference in New Issue
Block a user