diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations')
3 files changed, 18 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/UserDataManager.cs b/MediaBrowser.Server.Implementations/Library/UserDataManager.cs index 5dcfe0edd..34ad7f235 100644 --- a/MediaBrowser.Server.Implementations/Library/UserDataManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserDataManager.cs @@ -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> diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index d91f0ee0c..efb8dbe10 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -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)); } diff --git a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs index 6915cfc64..fb0bc9b7c 100644 --- a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs +++ b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs @@ -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) { |
