mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-24 00:33:05 +00:00
29 lines
No EOL
766 B
C#
29 lines
No EOL
766 B
C#
using NzbDrone.Core.Datastore;
|
|
using NzbDrone.Core.Instrumentation;
|
|
using NzbDrone.Api.Mapping;
|
|
|
|
namespace NzbDrone.Api.Logs
|
|
{
|
|
public class LogModule : NzbDroneRestModule<LogResource>
|
|
{
|
|
private readonly ILogService _logService;
|
|
|
|
public LogModule(ILogService logService)
|
|
{
|
|
_logService = logService;
|
|
GetResourcePaged = GetLogs;
|
|
}
|
|
|
|
private PagingResource<LogResource> GetLogs(PagingResource<LogResource> pagingResource)
|
|
{
|
|
var pageSpec = pagingResource.InjectTo<PagingSpec<Log>>();
|
|
|
|
if (pageSpec.SortKey == "time")
|
|
{
|
|
pageSpec.SortKey = "id";
|
|
}
|
|
|
|
return ApplyToPage(_logService.Paged, pageSpec);
|
|
}
|
|
}
|
|
} |