mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Moved source code under src folder - massive change
This commit is contained in:
29
src/NzbDrone.Api/History/HistoryModule.cs
Normal file
29
src/NzbDrone.Api/History/HistoryModule.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user