diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-09 13:38:02 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-09 13:38:02 -0400 |
| commit | e1f8c18b516f5bd31f64b8faaa53266a3daddd7a (patch) | |
| tree | b7f3212a71d19dfd99f44d50ba1fa85aa8e81b6b /MediaBrowser.Controller | |
| parent | f57cec4cff8feff70e62056549ea19bbd6a8316c (diff) | |
added ability to track web sockets per session
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Dto/DtoBuilder.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Library/IUserManager.cs | 55 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaBrowser.Controller.csproj | 1 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Session/ISessionManager.cs | 90 |
5 files changed, 95 insertions, 68 deletions
diff --git a/MediaBrowser.Controller/Dto/DtoBuilder.cs b/MediaBrowser.Controller/Dto/DtoBuilder.cs index d84227059..167ff2f78 100644 --- a/MediaBrowser.Controller/Dto/DtoBuilder.cs +++ b/MediaBrowser.Controller/Dto/DtoBuilder.cs @@ -832,6 +832,7 @@ namespace MediaBrowser.Controller.Dto { Id = GetClientItemId(item), Name = item.Name, + MediaType = item.MediaType, Type = item.GetType().Name, IsFolder = item.IsFolder, RunTimeTicks = item.RunTimeTicks @@ -844,16 +845,6 @@ namespace MediaBrowser.Controller.Dto info.PrimaryImageTag = Kernel.Instance.ImageManager.GetImageCacheTag(item, ImageType.Primary, imagePath); } - if (item.BackdropImagePaths != null && item.BackdropImagePaths.Count > 0) - { - imagePath = item.BackdropImagePaths[0]; - - if (!string.IsNullOrEmpty(imagePath)) - { - info.BackdropImageTag = Kernel.Instance.ImageManager.GetImageCacheTag(item, ImageType.Backdrop, imagePath); - } - } - return info; } diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index e31939d59..43c629505 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -683,7 +683,7 @@ namespace MediaBrowser.Controller.Entities /// Loads local trailers from the file system /// </summary> /// <returns>List{Video}.</returns> - private List<Trailer> LoadLocalTrailers() + private IEnumerable<Trailer> LoadLocalTrailers() { if (LocationType != LocationType.FileSystem) { @@ -746,7 +746,7 @@ namespace MediaBrowser.Controller.Entities /// Loads the theme songs. /// </summary> /// <returns>List{Audio.Audio}.</returns> - private List<Audio.Audio> LoadThemeSongs() + private IEnumerable<Audio.Audio> LoadThemeSongs() { if (LocationType != LocationType.FileSystem) { @@ -809,7 +809,7 @@ namespace MediaBrowser.Controller.Entities /// Loads the video backdrops. /// </summary> /// <returns>List{Video}.</returns> - private List<Video> LoadThemeVideos() + private IEnumerable<Video> LoadThemeVideos() { if (LocationType != LocationType.FileSystem) { diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs index 0fad1d05d..a0cea6200 100644 --- a/MediaBrowser.Controller/Library/IUserManager.cs +++ b/MediaBrowser.Controller/Library/IUserManager.cs @@ -1,6 +1,5 @@ using MediaBrowser.Common.Events; using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Connectivity; using System; using System.Collections.Generic; using System.Threading; @@ -20,12 +19,6 @@ namespace MediaBrowser.Controller.Library IEnumerable<User> Users { get; } /// <summary> - /// Gets the active connections. - /// </summary> - /// <value>The active connections.</value> - IEnumerable<ClientConnectionInfo> RecentConnections { get; } - - /// <summary> /// Occurs when [playback start]. /// </summary> event EventHandler<PlaybackProgressEventArgs> PlaybackStart; @@ -68,17 +61,6 @@ namespace MediaBrowser.Controller.Library Task<bool> AuthenticateUser(User user, string password); /// <summary> - /// Logs the user activity. - /// </summary> - /// <param name="user">The user.</param> - /// <param name="clientType">Type of the client.</param> - /// <param name="deviceId">The device id.</param> - /// <param name="deviceName">Name of the device.</param> - /// <returns>Task.</returns> - /// <exception cref="System.ArgumentNullException">user</exception> - Task LogUserActivity(User user, string clientType, string deviceId, string deviceName); - - /// <summary> /// Refreshes metadata for each user /// </summary> /// <param name="cancellationToken">The cancellation token.</param> @@ -123,43 +105,6 @@ namespace MediaBrowser.Controller.Library Task DeleteUser(User user); /// <summary> - /// Used to report that playback has started for an item - /// </summary> - /// <param name="user">The user.</param> - /// <param name="item">The item.</param> - /// <param name="clientType">Type of the client.</param> - /// <param name="deviceId">The device id.</param> - /// <param name="deviceName">Name of the device.</param> - /// <exception cref="System.ArgumentNullException"></exception> - void OnPlaybackStart(User user, BaseItem item, string clientType, string deviceId, string deviceName); - - /// <summary> - /// Used to report playback progress for an item - /// </summary> - /// <param name="user">The user.</param> - /// <param name="item">The item.</param> - /// <param name="positionTicks">The position ticks.</param> - /// <param name="clientType">Type of the client.</param> - /// <param name="deviceId">The device id.</param> - /// <param name="deviceName">Name of the device.</param> - /// <returns>Task.</returns> - /// <exception cref="System.ArgumentNullException"></exception> - Task OnPlaybackProgress(User user, BaseItem item, long? positionTicks, string clientType, string deviceId, string deviceName); - - /// <summary> - /// Used to report that playback has ended for an item - /// </summary> - /// <param name="user">The user.</param> - /// <param name="item">The item.</param> - /// <param name="positionTicks">The position ticks.</param> - /// <param name="clientType">Type of the client.</param> - /// <param name="deviceId">The device id.</param> - /// <param name="deviceName">Name of the device.</param> - /// <returns>Task.</returns> - /// <exception cref="System.ArgumentNullException"></exception> - Task OnPlaybackStopped(User user, BaseItem item, long? positionTicks, string clientType, string deviceId, string deviceName); - - /// <summary> /// Resets the password. /// </summary> /// <param name="user">The user.</param> diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 8c1cc5163..c54a446fb 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -70,6 +70,7 @@ <Link>Properties\SharedVersion.cs</Link> </Compile> <Compile Include="Configuration\IServerConfigurationManager.cs" /> + <Compile Include="Session\ISessionManager.cs" /> <Compile Include="Drawing\ImageExtensions.cs" /> <Compile Include="Drawing\ImageHeader.cs" /> <Compile Include="Drawing\ImageManager.cs" /> diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs new file mode 100644 index 000000000..66facdf6d --- /dev/null +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -0,0 +1,90 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Library; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using MediaBrowser.Model.Session; + +namespace MediaBrowser.Controller.Session +{ + /// <summary> + /// Interface ISessionManager + /// </summary> + public interface ISessionManager + { + /// <summary> + /// Occurs when [playback start]. + /// </summary> + event EventHandler<PlaybackProgressEventArgs> PlaybackStart; + + /// <summary> + /// Occurs when [playback progress]. + /// </summary> + event EventHandler<PlaybackProgressEventArgs> PlaybackProgress; + + /// <summary> + /// Occurs when [playback stopped]. + /// </summary> + event EventHandler<PlaybackProgressEventArgs> PlaybackStopped; + + /// <summary> + /// Gets all connections. + /// </summary> + /// <value>All connections.</value> + IEnumerable<SessionInfo> AllConnections { get; } + + /// <summary> + /// Gets the active connections. + /// </summary> + /// <value>The active connections.</value> + IEnumerable<SessionInfo> RecentConnections { get; } + + /// <summary> + /// Logs the user activity. + /// </summary> + /// <param name="clientType">Type of the client.</param> + /// <param name="deviceId">The device id.</param> + /// <param name="deviceName">Name of the device.</param> + /// <param name="user">The user.</param> + /// <returns>Task.</returns> + /// <exception cref="System.ArgumentNullException">user</exception> + Task LogConnectionActivity(string clientType, string deviceId, string deviceName, User user); + + /// <summary> + /// Used to report that playback has started for an item + /// </summary> + /// <param name="user">The user.</param> + /// <param name="item">The item.</param> + /// <param name="clientType">Type of the client.</param> + /// <param name="deviceId">The device id.</param> + /// <param name="deviceName">Name of the device.</param> + /// <exception cref="System.ArgumentNullException"></exception> + void OnPlaybackStart(User user, BaseItem item, string clientType, string deviceId, string deviceName); + + /// <summary> + /// Used to report playback progress for an item + /// </summary> + /// <param name="user">The user.</param> + /// <param name="item">The item.</param> + /// <param name="positionTicks">The position ticks.</param> + /// <param name="clientType">Type of the client.</param> + /// <param name="deviceId">The device id.</param> + /// <param name="deviceName">Name of the device.</param> + /// <returns>Task.</returns> + /// <exception cref="System.ArgumentNullException"></exception> + Task OnPlaybackProgress(User user, BaseItem item, long? positionTicks, string clientType, string deviceId, string deviceName); + + /// <summary> + /// Used to report that playback has ended for an item + /// </summary> + /// <param name="user">The user.</param> + /// <param name="item">The item.</param> + /// <param name="positionTicks">The position ticks.</param> + /// <param name="clientType">Type of the client.</param> + /// <param name="deviceId">The device id.</param> + /// <param name="deviceName">Name of the device.</param> + /// <returns>Task.</returns> + /// <exception cref="System.ArgumentNullException"></exception> + Task OnPlaybackStopped(User user, BaseItem item, long? positionTicks, string clientType, string deviceId, string deviceName); + } +}
\ No newline at end of file |
