From eb72c2db513f5306eecccb94f0f1cd5296a7d7db Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 2 Oct 2013 21:22:50 -0400 Subject: updated nuget --- .../Session/ISessionController.cs | 46 +++++++++++++++------- MediaBrowser.Controller/Session/ISessionManager.cs | 13 +++--- MediaBrowser.Controller/Session/SessionInfo.cs | 29 +++++++------- 3 files changed, 53 insertions(+), 35 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Session/ISessionController.cs b/MediaBrowser.Controller/Session/ISessionController.cs index f37d63b72..597a14cc6 100644 --- a/MediaBrowser.Controller/Session/ISessionController.cs +++ b/MediaBrowser.Controller/Session/ISessionController.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Model.Session; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Session; using System.Threading; using System.Threading.Tasks; @@ -7,55 +8,70 @@ namespace MediaBrowser.Controller.Session public interface ISessionController { /// - /// Supportses the specified session. + /// Gets a value indicating whether [supports media remote control]. /// - /// The session. - /// true if XXXX, false otherwise - bool Supports(SessionInfo session); + /// true if [supports media remote control]; otherwise, false. + bool SupportsMediaRemoteControl { get; } + + /// + /// Gets a value indicating whether this instance is session active. + /// + /// true if this instance is session active; otherwise, false. + bool IsSessionActive { get; } /// /// Sends the system command. /// - /// The session. /// The command. /// The cancellation token. /// Task. - Task SendSystemCommand(SessionInfo session, SystemCommand command, CancellationToken cancellationToken); + Task SendSystemCommand(SystemCommand command, CancellationToken cancellationToken); /// /// Sends the message command. /// - /// The session. /// The command. /// The cancellation token. /// Task. - Task SendMessageCommand(SessionInfo session, MessageCommand command, CancellationToken cancellationToken); + Task SendMessageCommand(MessageCommand command, CancellationToken cancellationToken); /// /// Sends the play command. /// - /// The session. /// The command. /// The cancellation token. /// Task. - Task SendPlayCommand(SessionInfo session, PlayRequest command, CancellationToken cancellationToken); + Task SendPlayCommand(PlayRequest command, CancellationToken cancellationToken); /// /// Sends the browse command. /// - /// The session. /// The command. /// The cancellation token. /// Task. - Task SendBrowseCommand(SessionInfo session, BrowseRequest command, CancellationToken cancellationToken); + Task SendBrowseCommand(BrowseRequest command, CancellationToken cancellationToken); /// /// Sends the playstate command. /// - /// The session. /// The command. /// The cancellation token. /// Task. - Task SendPlaystateCommand(SessionInfo session, PlaystateRequest command, CancellationToken cancellationToken); + Task SendPlaystateCommand(PlaystateRequest command, CancellationToken cancellationToken); + + /// + /// Sends the library update info. + /// + /// The info. + /// The cancellation token. + /// Task. + Task SendLibraryUpdateInfo(LibraryUpdateInfo info, CancellationToken cancellationToken); + + /// + /// Sends the restart required message. + /// + /// The cancellation token. + /// Task. + Task SendRestartRequiredMessage(CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 6ee57eb46..b2d111e54 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -13,12 +13,6 @@ namespace MediaBrowser.Controller.Session /// public interface ISessionManager { - /// - /// Adds the parts. - /// - /// The remote controllers. - void AddParts(IEnumerable remoteControllers); - /// /// Occurs when [playback start]. /// @@ -119,5 +113,12 @@ namespace MediaBrowser.Controller.Session /// The cancellation token. /// Task. Task SendPlaystateCommand(Guid sessionId, PlaystateRequest command, CancellationToken cancellationToken); + + /// + /// Sends the restart required message. + /// + /// The cancellation token. + /// Task. + Task SendRestartRequiredMessage(CancellationToken cancellationToken); } } \ No newline at end of file diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index d50f19c1f..ed2fcda67 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -1,9 +1,6 @@ -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Net; +using MediaBrowser.Controller.Entities; using System; using System.Collections.Generic; -using System.Linq; namespace MediaBrowser.Controller.Session { @@ -14,7 +11,6 @@ namespace MediaBrowser.Controller.Session { public SessionInfo() { - WebSockets = new List(); QueueableMediaTypes = new List(); } @@ -114,18 +110,18 @@ namespace MediaBrowser.Controller.Session /// The device id. public string DeviceId { get; set; } - /// - /// Gets or sets the web socket. - /// - /// The web socket. - public List WebSockets { get; set; } - /// /// Gets or sets the application version. /// /// The application version. public string ApplicationVersion { get; set; } + /// + /// Gets or sets the session controller. + /// + /// The session controller. + public ISessionController SessionController { get; set; } + /// /// Gets a value indicating whether this instance is active. /// @@ -134,9 +130,9 @@ namespace MediaBrowser.Controller.Session { get { - if (WebSockets.Count > 0) + if (SessionController != null) { - return WebSockets.Any(i => i.State == WebSocketState.Open); + return SessionController.IsSessionActive; } return (DateTime.UtcNow - LastActivityDate).TotalMinutes <= 10; @@ -151,7 +147,12 @@ namespace MediaBrowser.Controller.Session { get { - return WebSockets.Any(i => i.State == WebSocketState.Open); + if (SessionController != null) + { + return SessionController.SupportsMediaRemoteControl; + } + + return false; } } } -- cgit v1.2.3