diff options
Diffstat (limited to 'MediaBrowser.Controller/Session')
| -rw-r--r-- | MediaBrowser.Controller/Session/ISessionManager.cs | 24 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Session/SessionInfo.cs | 40 |
2 files changed, 51 insertions, 13 deletions
diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 4082f5600..80025171d 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -1,5 +1,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Security; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Events; using MediaBrowser.Model.Session; @@ -73,7 +74,7 @@ namespace MediaBrowser.Controller.Session /// <summary> /// Logs the user activity. /// </summary> - /// <param name="clientType">Type of the client.</param> + /// <param name="appName">Type of the client.</param> /// <param name="appVersion">The app version.</param> /// <param name="deviceId">The device id.</param> /// <param name="deviceName">Name of the device.</param> @@ -81,7 +82,7 @@ namespace MediaBrowser.Controller.Session /// <param name="user">The user.</param> /// <returns>Task.</returns> /// <exception cref="System.ArgumentNullException">user</exception> - Task<SessionInfo> LogSessionActivity(string clientType, string appVersion, string deviceId, string deviceName, string remoteEndPoint, User user); + Task<SessionInfo> LogSessionActivity(string appName, string appVersion, string deviceId, string deviceName, string remoteEndPoint, User user); /// <summary> /// Used to report that playback has started for an item @@ -279,6 +280,25 @@ namespace MediaBrowser.Controller.Session SessionInfo GetSession(string deviceId, string client, string version); /// <summary> + /// Gets the session by authentication token. + /// </summary> + /// <param name="token">The token.</param> + /// <param name="deviceId">The device identifier.</param> + /// <param name="remoteEndpoint">The remote endpoint.</param> + /// <returns>SessionInfo.</returns> + Task<SessionInfo> GetSessionByAuthenticationToken(string token, string deviceId, string remoteEndpoint); + + /// <summary> + /// Gets the session by authentication token. + /// </summary> + /// <param name="info">The information.</param> + /// <param name="deviceId">The device identifier.</param> + /// <param name="remoteEndpoint">The remote endpoint.</param> + /// <param name="appVersion">The application version.</param> + /// <returns>Task<SessionInfo>.</returns> + Task<SessionInfo> GetSessionByAuthenticationToken(AuthenticationInfo info, string deviceId, string remoteEndpoint, string appVersion); + + /// <summary> /// Logouts the specified access token. /// </summary> /// <param name="accessToken">The access token.</param> diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index 078d4d70f..64b20c13e 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -14,17 +14,8 @@ namespace MediaBrowser.Controller.Session public SessionInfo() { QueueableMediaTypes = new List<string>(); - PlayableMediaTypes = new List<string> - { - MediaType.Audio, - MediaType.Book, - MediaType.Game, - MediaType.Photo, - MediaType.Video - }; AdditionalUsers = new List<SessionUserInfo>(); - SupportedCommands = new List<string>(); PlayState = new PlayerStateInfo(); } @@ -32,6 +23,8 @@ namespace MediaBrowser.Controller.Session public List<SessionUserInfo> AdditionalUsers { get; set; } + public ClientCapabilities Capabilities { get; set; } + /// <summary> /// Gets or sets the remote end point. /// </summary> @@ -48,7 +41,17 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the playable media types. /// </summary> /// <value>The playable media types.</value> - public List<string> PlayableMediaTypes { get; set; } + public List<string> PlayableMediaTypes + { + get + { + if (Capabilities == null) + { + return new List<string>(); + } + return Capabilities.PlayableMediaTypes; + } + } /// <summary> /// Gets or sets the id. @@ -126,7 +129,17 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the supported commands. /// </summary> /// <value>The supported commands.</value> - public List<string> SupportedCommands { get; set; } + public List<string> SupportedCommands + { + get + { + if (Capabilities == null) + { + return new List<string>(); + } + return Capabilities.SupportedCommands; + } + } public TranscodingInfo TranscodingInfo { get; set; } @@ -151,6 +164,11 @@ namespace MediaBrowser.Controller.Session { get { + if (Capabilities == null || !Capabilities.SupportsMediaControl) + { + return false; + } + if (SessionController != null) { return SessionController.SupportsMediaControl; |
