You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/NzbDrone.Api/History/HistoryModule.cs

29 lines
1.0 KiB

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);
}
}
}