mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-22 18:23:45 +00:00
added user data save event
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Common.Events;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.Entities;
|
||||
@@ -15,6 +16,8 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
/// </summary>
|
||||
public class UserDataManager : IUserDataManager
|
||||
{
|
||||
public event EventHandler<UserDataSaveEventArgs> UserDataSaved;
|
||||
|
||||
private readonly ConcurrentDictionary<string, UserItemData> _userData = new ConcurrentDictionary<string, UserItemData>();
|
||||
|
||||
private readonly ILogger _logger;
|
||||
@@ -84,6 +87,15 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
EventHelper.FireEventIfNotNull(UserDataSaved, this, new UserDataSaveEventArgs
|
||||
{
|
||||
Key = key,
|
||||
UserData = userData,
|
||||
SaveReason = reason,
|
||||
UserId = userId
|
||||
|
||||
}, _logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -78,8 +78,8 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
_userRepository = userRepository;
|
||||
}
|
||||
|
||||
private List<ISessionRemoteController> _remoteControllers;
|
||||
public void AddParts(IEnumerable<ISessionRemoteController> remoteControllers)
|
||||
private List<ISessionController> _remoteControllers;
|
||||
public void AddParts(IEnumerable<ISessionController> remoteControllers)
|
||||
{
|
||||
_remoteControllers = remoteControllers.ToList();
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
/// <returns>Task.</returns>
|
||||
/// <exception cref="System.UnauthorizedAccessException"></exception>
|
||||
/// <exception cref="System.ArgumentNullException">user</exception>
|
||||
public async Task<SessionInfo> LogConnectionActivity(string clientType, string appVersion, string deviceId, string deviceName, User user)
|
||||
public async Task<SessionInfo> LogSessionActivity(string clientType, string appVersion, string deviceId, string deviceName, User user)
|
||||
{
|
||||
if (string.IsNullOrEmpty(clientType))
|
||||
{
|
||||
@@ -442,7 +442,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
/// </summary>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <returns>IEnumerable{ISessionRemoteController}.</returns>
|
||||
private IEnumerable<ISessionRemoteController> GetControllers(SessionInfo session)
|
||||
private IEnumerable<ISessionController> GetControllers(SessionInfo session)
|
||||
{
|
||||
return _remoteControllers.Where(i => i.Supports(session));
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Session
|
||||
{
|
||||
public class WebSocketController : ISessionRemoteController
|
||||
public class WebSocketController : ISessionController
|
||||
{
|
||||
public bool Supports(SessionInfo session)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user