Episode Activity added

New: Activity tab added to Episode Details
This commit is contained in:
Mark McDowall
2013-10-03 23:01:02 -07:00
parent d0d65db4f2
commit c0b7612053
14 changed files with 182 additions and 15 deletions
@@ -12,6 +12,7 @@ namespace NzbDrone.Core.History
{
void Trim();
List<QualityModel> GetEpisodeHistory(int episodeId);
List<History> ByEpisode(int episodeId);
}
public class HistoryRepository : BasicRepository<History>, IHistoryRepository
@@ -37,6 +38,11 @@ namespace NzbDrone.Core.History
return history.Select(h => h.Quality).ToList();
}
public List<History> ByEpisode(int episodeId)
{
return Query.Where(h => h.EpisodeId == episodeId).ToList();
}
public override PagingSpec<History> GetPaged(PagingSpec<History> pagingSpec)
{
var pagingQuery = Query.Join<History, Series>(JoinType.Inner, h => h.Series, (h, s) => h.SeriesId == s.Id)
@@ -17,6 +17,7 @@ namespace NzbDrone.Core.History
void Trim();
QualityModel GetBestQualityInHistory(int episodeId);
PagingSpec<History> Paged(PagingSpec<History> pagingSpec);
List<History> ByEpisode(int episodeId);
}
public class HistoryService : IHistoryService, IHandle<EpisodeGrabbedEvent>, IHandle<EpisodeImportedEvent>
@@ -40,6 +41,11 @@ namespace NzbDrone.Core.History
return _historyRepository.GetPaged(pagingSpec);
}
public List<History> ByEpisode(int episodeId)
{
return _historyRepository.ByEpisode(episodeId);
}
public void Purge()
{
_historyRepository.Purge();