From 8610a9b7ef9a976dfdcc68f5171b0c366dc518b9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 19 Feb 2015 14:21:03 -0500 Subject: Update to use SupportsMediaControl --- MediaBrowser.Controller/Session/SessionInfo.cs | 40 +++++++++++++++++++------- 1 file changed, 29 insertions(+), 11 deletions(-) (limited to 'MediaBrowser.Controller/Session') 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(); - PlayableMediaTypes = new List - { - MediaType.Audio, - MediaType.Book, - MediaType.Game, - MediaType.Photo, - MediaType.Video - }; AdditionalUsers = new List(); - SupportedCommands = new List(); PlayState = new PlayerStateInfo(); } @@ -32,6 +23,8 @@ namespace MediaBrowser.Controller.Session public List AdditionalUsers { get; set; } + public ClientCapabilities Capabilities { get; set; } + /// /// Gets or sets the remote end point. /// @@ -48,7 +41,17 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the playable media types. /// /// The playable media types. - public List PlayableMediaTypes { get; set; } + public List PlayableMediaTypes + { + get + { + if (Capabilities == null) + { + return new List(); + } + return Capabilities.PlayableMediaTypes; + } + } /// /// Gets or sets the id. @@ -126,7 +129,17 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the supported commands. /// /// The supported commands. - public List SupportedCommands { get; set; } + public List SupportedCommands + { + get + { + if (Capabilities == null) + { + return new List(); + } + 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; -- cgit v1.2.3