|
|
|
@ -10,7 +10,7 @@ namespace NzbDrone.Core.Blacklisting
|
|
|
|
|
{
|
|
|
|
|
List<Blacklist> BlacklistedByTitle(int seriesId, string sourceTitle);
|
|
|
|
|
List<Blacklist> BlacklistedByTorrentInfoHash(int seriesId, string torrentInfoHash);
|
|
|
|
|
List<Blacklist> BlacklistedBySeries(int seriesId);
|
|
|
|
|
List<Blacklist> BlacklistedByMovie(int seriesId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class BlacklistRepository : BasicRepository<Blacklist>, IBlacklistRepository
|
|
|
|
@ -20,15 +20,15 @@ namespace NzbDrone.Core.Blacklisting
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Blacklist> BlacklistedByTitle(int seriesId, string sourceTitle)
|
|
|
|
|
public List<Blacklist> BlacklistedByTitle(int movieId, string sourceTitle)
|
|
|
|
|
{
|
|
|
|
|
return Query.Where(e => e.SeriesId == seriesId)
|
|
|
|
|
return Query.Where(e => e.MovieId == movieId)
|
|
|
|
|
.AndWhere(e => e.SourceTitle.Contains(sourceTitle));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Blacklist> BlacklistedByTorrentInfoHash(int seriesId, string torrentInfoHash)
|
|
|
|
|
public List<Blacklist> BlacklistedByTorrentInfoHash(int movieId, string torrentInfoHash)
|
|
|
|
|
{
|
|
|
|
|
return Query.Where(e => e.SeriesId == seriesId)
|
|
|
|
|
return Query.Where(e => e.MovieId == movieId)
|
|
|
|
|
.AndWhere(e => e.TorrentInfoHash.Contains(torrentInfoHash));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -37,9 +37,14 @@ namespace NzbDrone.Core.Blacklisting
|
|
|
|
|
return Query.Where(b => b.SeriesId == seriesId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Blacklist> BlacklistedByMovie(int movieId)
|
|
|
|
|
{
|
|
|
|
|
return Query.Where(b => b.MovieId == movieId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override SortBuilder<Blacklist> GetPagedQuery(QueryBuilder<Blacklist> query, PagingSpec<Blacklist> pagingSpec)
|
|
|
|
|
{
|
|
|
|
|
var baseQuery = query.Join<Blacklist, Series>(JoinType.Inner, h => h.Series, (h, s) => h.SeriesId == s.Id);
|
|
|
|
|
var baseQuery = query.Join<Blacklist, Movie>(JoinType.Inner, h => h.Movie, (h, s) => h.MovieId == s.Id);
|
|
|
|
|
|
|
|
|
|
return base.GetPagedQuery(baseQuery, pagingSpec);
|
|
|
|
|
}
|
|
|
|
|