diff --git a/src/NzbDrone.Api/Blacklist/BlacklistResource.cs b/src/NzbDrone.Api/Blacklist/BlacklistResource.cs index b9638cf9c..e75ca83f3 100644 --- a/src/NzbDrone.Api/Blacklist/BlacklistResource.cs +++ b/src/NzbDrone.Api/Blacklist/BlacklistResource.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using NzbDrone.Api.REST; using NzbDrone.Core.Qualities; +using NzbDrone.Api.Series; namespace NzbDrone.Api.Blacklist { @@ -12,5 +13,7 @@ public class BlacklistResource : RestResource public string SourceTitle { get; set; } public QualityModel Quality { get; set; } public DateTime Date { get; set; } + + public SeriesResource Series { get; set; } } } diff --git a/src/NzbDrone.Core/Blacklisting/Blacklist.cs b/src/NzbDrone.Core/Blacklisting/Blacklist.cs index 19dd800a6..91c927f05 100644 --- a/src/NzbDrone.Core/Blacklisting/Blacklist.cs +++ b/src/NzbDrone.Core/Blacklisting/Blacklist.cs @@ -2,12 +2,14 @@ using System.Collections.Generic; using NzbDrone.Core.Datastore; using NzbDrone.Core.Qualities; +using NzbDrone.Core.Tv; namespace NzbDrone.Core.Blacklisting { public class Blacklist : ModelBase { public Int32 SeriesId { get; set; } + public Series Series { get; set; } public List EpisodeIds { get; set; } public String SourceTitle { get; set; } public QualityModel Quality { get; set; } diff --git a/src/NzbDrone.Core/Blacklisting/BlacklistRepository.cs b/src/NzbDrone.Core/Blacklisting/BlacklistRepository.cs index 4e105865f..681fcdf98 100644 --- a/src/NzbDrone.Core/Blacklisting/BlacklistRepository.cs +++ b/src/NzbDrone.Core/Blacklisting/BlacklistRepository.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using NzbDrone.Core.Datastore; using NzbDrone.Core.Messaging.Events; +using Marr.Data.QGen; +using NzbDrone.Core.Tv; namespace NzbDrone.Core.Blacklisting { @@ -27,5 +29,12 @@ public List BlacklistedBySeries(int seriesId) { return Query.Where(b => b.SeriesId == seriesId); } + + protected override SortBuilder GetPagedQuery(QueryBuilder query, PagingSpec pagingSpec) + { + var baseQuery = query.Join(JoinType.Inner, h => h.Series, (h, s) => h.SeriesId == s.Id); + + return base.GetPagedQuery(baseQuery, pagingSpec); + } } }