mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-29 11:16:19 +00:00
25 lines
738 B
C#
25 lines
738 B
C#
|
using NzbDrone.Core.Datastore;
|
|||
|
using NzbDrone.Core.History;
|
|||
|
using NzbDrone.Core.Instrumentation;
|
|||
|
using NzbDrone.Api.Mapping;
|
|||
|
|
|||
|
namespace NzbDrone.Api.Logs
|
|||
|
{
|
|||
|
public class LogModule : NzbDroneRestModule<LogResource>
|
|||
|
{
|
|||
|
private readonly ILogService _logService;
|
|||
|
private readonly IHistoryService _historyService;
|
|||
|
|
|||
|
public LogModule(ILogService logService)
|
|||
|
{
|
|||
|
_logService = logService;
|
|||
|
GetResourcePaged = GetLogs;
|
|||
|
}
|
|||
|
|
|||
|
private PagingResource<LogResource> GetLogs(PagingResource<LogResource> pagingResource)
|
|||
|
{
|
|||
|
var pageSpec = pagingResource.InjectTo<PagingSpec<Log>>();
|
|||
|
return ApplyToPage(_logService.Paged, pageSpec);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|