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

29 lines
919 B
C#
Raw Normal View History

2013-05-13 09:12:19 +03:00
using NzbDrone.Core.Datastore;
2013-03-21 06:02:57 +03:00
using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Missing
{
2013-05-13 09:12:19 +03:00
public class MissingModule : NzbDroneRestModule<MissingResource>
2013-03-21 06:02:57 +03:00
{
2013-04-01 09:22:16 +03:00
private readonly IEpisodeService _episodeService;
2013-03-21 06:02:57 +03:00
2013-04-01 09:22:16 +03:00
public MissingModule(IEpisodeService episodeService)
2013-03-21 06:02:57 +03:00
{
_episodeService = episodeService;
2013-05-13 09:12:19 +03:00
GetResourcePaged = GetMissingEpisodes;
2013-03-21 06:02:57 +03:00
}
2013-05-13 09:12:19 +03:00
private PagingResource<MissingResource> GetMissingEpisodes(PagingResource<MissingResource> pagingResource)
2013-03-21 06:02:57 +03:00
{
2013-05-02 08:50:34 +03:00
var pagingSpec = new PagingSpec<Episode>
2013-05-13 09:12:19 +03:00
{
Page = pagingResource.Page,
PageSize = pagingResource.PageSize,
SortKey = pagingResource.SortKey,
SortDirection = pagingResource.SortDirection
};
return ApplyToPage(_episodeService.EpisodesWithoutFiles, pagingSpec);
2013-03-21 06:02:57 +03:00
}
}
}