aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-02 21:22:50 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-02 21:22:50 -0400
commiteb72c2db513f5306eecccb94f0f1cd5296a7d7db (patch)
treea344f75c10085a9a8f5ac57c4926dbab09161e45 /MediaBrowser.Controller
parent33a3e215d03d2e8dad3e653e7c75258dc7eb4989 (diff)
updated nuget
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Session/ISessionController.cs46
-rw-r--r--MediaBrowser.Controller/Session/ISessionManager.cs13
-rw-r--r--MediaBrowser.Controller/Session/SessionInfo.cs29
3 files changed, 53 insertions, 35 deletions
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
{
/// <summary>
- /// Supportses the specified session.
+ /// Gets a value indicating whether [supports media remote control].
/// </summary>
- /// <param name="session">The session.</param>
- /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
- bool Supports(SessionInfo session);
+ /// <value><c>true</c> if [supports media remote control]; otherwise, <c>false</c>.</value>
+ bool SupportsMediaRemoteControl { get; }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is session active.
+ /// </summary>
+ /// <value><c>true</c> if this instance is session active; otherwise, <c>false</c>.</value>
+ bool IsSessionActive { get; }
/// <summary>
/// Sends the system command.
/// </summary>
- /// <param name="session">The session.</param>
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendSystemCommand(SessionInfo session, SystemCommand command, CancellationToken cancellationToken);
+ Task SendSystemCommand(SystemCommand command, CancellationToken cancellationToken);
/// <summary>
/// Sends the message command.
/// </summary>
- /// <param name="session">The session.</param>
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendMessageCommand(SessionInfo session, MessageCommand command, CancellationToken cancellationToken);
+ Task SendMessageCommand(MessageCommand command, CancellationToken cancellationToken);
/// <summary>
/// Sends the play command.
/// </summary>
- /// <param name="session">The session.</param>
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendPlayCommand(SessionInfo session, PlayRequest command, CancellationToken cancellationToken);
+ Task SendPlayCommand(PlayRequest command, CancellationToken cancellationToken);
/// <summary>
/// Sends the browse command.
/// </summary>
- /// <param name="session">The session.</param>
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendBrowseCommand(SessionInfo session, BrowseRequest command, CancellationToken cancellationToken);
+ Task SendBrowseCommand(BrowseRequest command, CancellationToken cancellationToken);
/// <summary>
/// Sends the playstate command.
/// </summary>
- /// <param name="session">The session.</param>
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendPlaystateCommand(SessionInfo session, PlaystateRequest command, CancellationToken cancellationToken);
+ Task SendPlaystateCommand(PlaystateRequest command, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Sends the library update info.
+ /// </summary>
+ /// <param name="info">The info.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task.</returns>
+ Task SendLibraryUpdateInfo(LibraryUpdateInfo info, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Sends the restart required message.
+ /// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task.</returns>
+ 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
@@ -14,12 +14,6 @@ namespace MediaBrowser.Controller.Session
public interface ISessionManager
{
/// <summary>
- /// Adds the parts.
- /// </summary>
- /// <param name="remoteControllers">The remote controllers.</param>
- void AddParts(IEnumerable<ISessionController> remoteControllers);
-
- /// <summary>
/// Occurs when [playback start].
/// </summary>
event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
@@ -119,5 +113,12 @@ namespace MediaBrowser.Controller.Session
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SendPlaystateCommand(Guid sessionId, PlaystateRequest command, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Sends the restart required message.
+ /// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task.</returns>
+ 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<IWebSocketConnection>();
QueueableMediaTypes = new List<string>();
}
@@ -115,18 +111,18 @@ namespace MediaBrowser.Controller.Session
public string DeviceId { get; set; }
/// <summary>
- /// Gets or sets the web socket.
- /// </summary>
- /// <value>The web socket.</value>
- public List<IWebSocketConnection> WebSockets { get; set; }
-
- /// <summary>
/// Gets or sets the application version.
/// </summary>
/// <value>The application version.</value>
public string ApplicationVersion { get; set; }
/// <summary>
+ /// Gets or sets the session controller.
+ /// </summary>
+ /// <value>The session controller.</value>
+ public ISessionController SessionController { get; set; }
+
+ /// <summary>
/// Gets a value indicating whether this instance is active.
/// </summary>
/// <value><c>true</c> if this instance is active; otherwise, <c>false</c>.</value>
@@ -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;
}
}
}