From 0eaba37c1157df5e42a6025c404dce6b56b6562b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 13 May 2014 20:46:45 -0400 Subject: add library to front page --- .../Session/SessionManager.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Session') diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index cf27df70df..26e451a815 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 PlaybackStopped; public event EventHandler SessionStarted; - + public event EventHandler CapabilitiesChanged; public event EventHandler SessionEnded; + public event EventHandler SessionActivity; private IEnumerable _sessionFactories = new List(); @@ -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) -- cgit v1.2.3