1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-13 22:43:35 +01:00
Radarr/NzbDrone.Api/History/HistoryModule.cs
2013-05-30 17:15:22 -07:00

29 lines
1.0 KiB
C#

using NzbDrone.Core.Datastore;
using NzbDrone.Core.History;
namespace NzbDrone.Api.History
{
public class HistoryModule : NzbDroneRestModule<HistoryResource>
{
private readonly IHistoryService _historyService;
public HistoryModule(IHistoryService historyService)
{
_historyService = historyService;
GetResourcePaged = GetHistory;
}
private PagingResource<HistoryResource> GetHistory(PagingResource<HistoryResource> pagingResource)
{
var pagingSpec = new PagingSpec<Core.History.History>
{
Page = pagingResource.Page,
PageSize = pagingResource.PageSize,
SortKey = pagingResource.SortKey,
SortDirection = pagingResource.SortDirection
};
return ApplyToPage(_historyService.Paged, pagingSpec);
}
}
}