mirror of
https://github.com/Radarr/Radarr
synced 2024-12-27 18:30:45 +00:00
29 lines
No EOL
1 KiB
C#
29 lines
No EOL
1 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);
|
|
}
|
|
}
|
|
} |