1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-14 15:03:42 +01:00
Radarr/NzbDrone.Api/History/HistoryModule.cs

29 lines
1.0 KiB
C#
Raw Normal View History

2013-05-31 02:12:20 +02:00
using NzbDrone.Core.Datastore;
2013-05-03 08:53:32 +02:00
using NzbDrone.Core.History;
namespace NzbDrone.Api.History
{
2013-05-13 08:12:19 +02:00
public class HistoryModule : NzbDroneRestModule<HistoryResource>
2013-05-03 08:53:32 +02:00
{
private readonly IHistoryService _historyService;
public HistoryModule(IHistoryService historyService)
{
_historyService = historyService;
2013-05-13 08:12:19 +02:00
GetResourcePaged = GetHistory;
2013-05-03 08:53:32 +02:00
}
2013-05-13 08:12:19 +02:00
private PagingResource<HistoryResource> GetHistory(PagingResource<HistoryResource> pagingResource)
2013-05-03 08:53:32 +02:00
{
2013-05-11 00:33:04 +02:00
var pagingSpec = new PagingSpec<Core.History.History>
2013-05-03 08:53:32 +02:00
{
2013-05-13 08:12:19 +02:00
Page = pagingResource.Page,
PageSize = pagingResource.PageSize,
SortKey = pagingResource.SortKey,
SortDirection = pagingResource.SortDirection
2013-05-03 08:53:32 +02:00
};
2013-05-13 08:12:19 +02:00
return ApplyToPage(_historyService.Paged, pagingSpec);
2013-05-03 08:53:32 +02:00
}
}
}