You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Jellyfin.Data.Entities;
|
|
|
|
|
using Jellyfin.Data.Events.Users;
|
|
|
|
|
using MediaBrowser.Controller.Events;
|
|
|
|
|
using MediaBrowser.Model.Activity;
|
|
|
|
|
using MediaBrowser.Model.Globalization;
|
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Server.Implementations.Events.Consumers.Users
|
|
|
|
|
{
|
|
|
|
|
public class UserDeletedLogger : IEventConsumer<UserDeletedEventArgs>
|
|
|
|
|
{
|
|
|
|
|
private readonly ILocalizationManager _localizationManager;
|
|
|
|
|
private readonly IActivityManager _activityManager;
|
|
|
|
|
|
|
|
|
|
public UserDeletedLogger(ILocalizationManager localizationManager, IActivityManager activityManager)
|
|
|
|
|
{
|
|
|
|
|
_localizationManager = localizationManager;
|
|
|
|
|
_activityManager = activityManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task OnEvent(UserDeletedEventArgs eventArgs)
|
|
|
|
|
{
|
|
|
|
|
await _activityManager.CreateAsync(new ActivityLog(
|
|
|
|
|
string.Format(
|
|
|
|
|
CultureInfo.InvariantCulture,
|
|
|
|
|
_localizationManager.GetLocalizedString("UserDeletedWithName"),
|
|
|
|
|
eventArgs.Argument.Username),
|
|
|
|
|
"UserDeleted",
|
|
|
|
|
Guid.Empty))
|
|
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|