Add ability to sort and filter activity log entries (#15583)

This commit is contained in:
Cody Robibero
2025-12-08 21:01:32 -07:00
committed by GitHub
parent c3a8734adf
commit 0b3d6676d1
5 changed files with 364 additions and 106 deletions

View File

@@ -1,5 +1,3 @@
#pragma warning disable CS1591
using System;
using System.Threading.Tasks;
using Jellyfin.Data.Events;
@@ -7,21 +5,36 @@ using Jellyfin.Data.Queries;
using Jellyfin.Database.Implementations.Entities;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Model.Activity
namespace MediaBrowser.Model.Activity;
/// <summary>
/// Interface for the activity manager.
/// </summary>
public interface IActivityManager
{
public interface IActivityManager
{
event EventHandler<GenericEventArgs<ActivityLogEntry>> EntryCreated;
/// <summary>
/// The event that is triggered when an entity is created.
/// </summary>
event EventHandler<GenericEventArgs<ActivityLogEntry>> EntryCreated;
Task CreateAsync(ActivityLog entry);
/// <summary>
/// Create a new activity log entry.
/// </summary>
/// <param name="entry">The entry to create.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task CreateAsync(ActivityLog entry);
Task<QueryResult<ActivityLogEntry>> GetPagedResultAsync(ActivityLogQuery query);
/// <summary>
/// Get a paged list of activity log entries.
/// </summary>
/// <param name="query">The activity log query.</param>
/// <returns>The page of entries.</returns>
Task<QueryResult<ActivityLogEntry>> GetPagedResultAsync(ActivityLogQuery query);
/// <summary>
/// Remove all activity logs before the specified date.
/// </summary>
/// <param name="startDate">Activity log start date.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task CleanAsync(DateTime startDate);
}
/// <summary>
/// Remove all activity logs before the specified date.
/// </summary>
/// <param name="startDate">Activity log start date.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task CleanAsync(DateTime startDate);
}