mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 08:15:28 +03:00
add activity log feature
This commit is contained in:
44
MediaBrowser.Api/System/ActivityLogService.cs
Normal file
44
MediaBrowser.Api/System/ActivityLogService.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using MediaBrowser.Controller.Activity;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using ServiceStack;
|
||||
|
||||
namespace MediaBrowser.Api.System
|
||||
{
|
||||
[Route("/System/ActivityLog/Entries", "GET", Summary = "Gets activity log entries")]
|
||||
public class GetActivityLogs : IReturn<QueryResult<ActivityLogEntry>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Skips over a given number of items within the results. Use for paging.
|
||||
/// </summary>
|
||||
/// <value>The start index.</value>
|
||||
[ApiMember(Name = "StartIndex", Description = "Optional. The record index to start at. All items with a lower index will be dropped from the results.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public int? StartIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The maximum number of items to return
|
||||
/// </summary>
|
||||
/// <value>The limit.</value>
|
||||
[ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
|
||||
[Authenticated]
|
||||
public class ActivityLogService : BaseApiService
|
||||
{
|
||||
private readonly IActivityManager _activityManager;
|
||||
|
||||
public ActivityLogService(IActivityManager activityManager)
|
||||
{
|
||||
_activityManager = activityManager;
|
||||
}
|
||||
|
||||
public object Get(GetActivityLogs request)
|
||||
{
|
||||
var result = _activityManager.GetActivityLogEntries(request.StartIndex, request.Limit);
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user