Files
pgsql-jellyfin/Jellyfin.Server.Implementations/Events/Consumers/Users/UserDeletedLogger.cs
T
wjones af1152b001 Refactor: standardize namespace and using directive style
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
2026-02-20 16:26:53 -05:00

49 lines
1.8 KiB
C#

// <copyright file="UserDeletedLogger.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Server.Implementations.Events.Consumers.Users
{
using System;
using System.Globalization;
using System.Threading.Tasks;
using Jellyfin.Data.Events.Users;
using Jellyfin.Database.Implementations.Entities;
using MediaBrowser.Controller.Events;
using MediaBrowser.Model.Activity;
using MediaBrowser.Model.Globalization;
/// <summary>
/// Adds an entry to the activity log when a user is deleted.
/// </summary>
public class UserDeletedLogger : IEventConsumer<UserDeletedEventArgs>
{
private readonly ILocalizationManager _localizationManager;
private readonly IActivityManager _activityManager;
/// <summary>
/// Initializes a new instance of the <see cref="UserDeletedLogger"/> class.
/// </summary>
/// <param name="localizationManager">The localization manager.</param>
/// <param name="activityManager">The activity manager.</param>
public UserDeletedLogger(ILocalizationManager localizationManager, IActivityManager activityManager)
{
_localizationManager = localizationManager;
_activityManager = activityManager;
}
/// <inheritdoc />
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);
}
}
}