1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Api/Missing/MissingModule.cs
2013-05-12 23:12:56 -07:00

29 lines
919 B
C#

using NzbDrone.Core.Datastore;
using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Missing
{
public class MissingModule : NzbDroneRestModule<MissingResource>
{
private readonly IEpisodeService _episodeService;
public MissingModule(IEpisodeService episodeService)
{
_episodeService = episodeService;
GetResourcePaged = GetMissingEpisodes;
}
private PagingResource<MissingResource> GetMissingEpisodes(PagingResource<MissingResource> pagingResource)
{
var pagingSpec = new PagingSpec<Episode>
{
Page = pagingResource.Page,
PageSize = pagingResource.PageSize,
SortKey = pagingResource.SortKey,
SortDirection = pagingResource.SortDirection
};
return ApplyToPage(_episodeService.EpisodesWithoutFiles, pagingSpec);
}
}
}