mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
added /logs
This commit is contained in:
parent
fc7d4536ac
commit
9160343a51
16 changed files with 231 additions and 16 deletions
25
NzbDrone.Api/Logs/LogModule.cs
Normal file
25
NzbDrone.Api/Logs/LogModule.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue