diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-13 20:46:45 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-13 20:46:45 -0400 |
| commit | 0eaba37c1157df5e42a6025c404dce6b56b6562b (patch) | |
| tree | 0194234c61c1435d31ab046eed33cd3d88055be1 /MediaBrowser.Server.Implementations/Session/SessionManager.cs | |
| parent | d4d10f6e433cc472c5aafe6af53a101bba36bf79 (diff) | |
add library to front page
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionManager.cs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index cf27df70d..26e451a81 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -77,8 +77,9 @@ namespace MediaBrowser.Server.Implementations.Session public event EventHandler<PlaybackStopEventArgs> PlaybackStopped; public event EventHandler<SessionEventArgs> SessionStarted; - + public event EventHandler<SessionEventArgs> CapabilitiesChanged; public event EventHandler<SessionEventArgs> SessionEnded; + public event EventHandler<SessionEventArgs> SessionActivity; private IEnumerable<ISessionControllerFactory> _sessionFactories = new List<ISessionControllerFactory>(); @@ -224,10 +225,16 @@ namespace MediaBrowser.Server.Implementations.Session { return session; } - + // Save this directly. No need to fire off all the events for this. await _userRepository.SaveUser(user, CancellationToken.None).ConfigureAwait(false); + EventHelper.FireEventIfNotNull(SessionActivity, this, new SessionEventArgs + { + SessionInfo = session + + }, _logger); + return session; } @@ -517,7 +524,7 @@ namespace MediaBrowser.Server.Implementations.Session } } - EventHelper.QueueEventIfNotNull(PlaybackProgress, this, new PlaybackProgressEventArgs + EventHelper.FireEventIfNotNull(PlaybackProgress, this, new PlaybackProgressEventArgs { Item = libraryItem, Users = users, @@ -1127,6 +1134,12 @@ namespace MediaBrowser.Server.Implementations.Session session.PlayableMediaTypes = capabilities.PlayableMediaTypes; session.SupportedCommands = capabilities.SupportedCommands; + + EventHelper.FireEventIfNotNull(CapabilitiesChanged, this, new SessionEventArgs + { + SessionInfo = session + + }, _logger); } public SessionInfoDto GetSessionInfoDto(SessionInfo session) |
