aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-02 15:08:58 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-02 15:08:58 -0400
commit33a3e215d03d2e8dad3e653e7c75258dc7eb4989 (patch)
treef6becfc2487bfd7e6c8b6b29c6a615a727c6e887 /MediaBrowser.Server.Implementations
parent0abc9d34937f2b1d6cddc5dcc45766940650c8c3 (diff)
added user data save event
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Library/UserDataManager.cs14
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionManager.cs8
-rw-r--r--MediaBrowser.Server.Implementations/Session/WebSocketController.cs2
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)
{