aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Dlna/DlnaIconResponse.cs22
-rw-r--r--MediaBrowser.Controller/Dlna/IDlnaManager.cs7
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj4
-rw-r--r--MediaBrowser.Controller/Session/ISessionManager.cs37
-rw-r--r--MediaBrowser.Controller/Session/PlaybackInfo.cs56
-rw-r--r--MediaBrowser.Controller/Session/PlaybackProgressInfo.cs62
-rw-r--r--MediaBrowser.Controller/Session/PlaybackStopInfo.cs32
-rw-r--r--MediaBrowser.Controller/Session/SessionInfo.cs69
8 files changed, 64 insertions, 225 deletions
diff --git a/MediaBrowser.Controller/Dlna/DlnaIconResponse.cs b/MediaBrowser.Controller/Dlna/DlnaIconResponse.cs
new file mode 100644
index 000000000..04d8e88b9
--- /dev/null
+++ b/MediaBrowser.Controller/Dlna/DlnaIconResponse.cs
@@ -0,0 +1,22 @@
+using MediaBrowser.Controller.Drawing;
+using System;
+using System.IO;
+
+namespace MediaBrowser.Controller.Dlna
+{
+ public class DlnaIconResponse : IDisposable
+ {
+ public Stream Stream { get; set; }
+
+ public ImageFormat Format { get; set; }
+
+ public void Dispose()
+ {
+ if (Stream != null)
+ {
+ Stream.Dispose();
+ Stream = null;
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/Dlna/IDlnaManager.cs b/MediaBrowser.Controller/Dlna/IDlnaManager.cs
index bcccaaa2e..e9e2aae54 100644
--- a/MediaBrowser.Controller/Dlna/IDlnaManager.cs
+++ b/MediaBrowser.Controller/Dlna/IDlnaManager.cs
@@ -77,5 +77,12 @@ namespace MediaBrowser.Controller.Dlna
/// <param name="request">The request.</param>
/// <returns>ControlResponse.</returns>
ControlResponse ProcessControlRequest(ControlRequest request);
+
+ /// <summary>
+ /// Gets the icon.
+ /// </summary>
+ /// <param name="filename">The filename.</param>
+ /// <returns>DlnaIconResponse.</returns>
+ DlnaIconResponse GetIcon(string filename);
}
}
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index 692a7a92e..235c3c1e5 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -79,6 +79,7 @@
<Compile Include="Collections\CollectionCreationOptions.cs" />
<Compile Include="Collections\ICollectionManager.cs" />
<Compile Include="Dlna\ControlRequest.cs" />
+ <Compile Include="Dlna\DlnaIconResponse.cs" />
<Compile Include="Dlna\IDlnaManager.cs" />
<Compile Include="Drawing\IImageProcessor.cs" />
<Compile Include="Drawing\ImageFormat.cs" />
@@ -251,9 +252,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Session\ISessionController.cs" />
<Compile Include="Session\ISessionControllerFactory.cs" />
- <Compile Include="Session\PlaybackInfo.cs" />
- <Compile Include="Session\PlaybackProgressInfo.cs" />
- <Compile Include="Session\PlaybackStopInfo.cs" />
<Compile Include="Session\SessionEventArgs.cs" />
<Compile Include="Session\SessionInfo.cs" />
<Compile Include="Sorting\IBaseItemComparer.cs" />
diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs
index f2edca082..54f371631 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.Model.Entities;
using MediaBrowser.Model.Session;
using System;
using System.Collections.Generic;
@@ -68,7 +69,7 @@ namespace MediaBrowser.Controller.Session
/// </summary>
/// <param name="info">The info.</param>
/// <returns>Task.</returns>
- Task OnPlaybackStart(PlaybackInfo info);
+ Task OnPlaybackStart(PlaybackStartInfo info);
/// <summary>
/// Used to report playback progress for an item
@@ -91,7 +92,7 @@ namespace MediaBrowser.Controller.Session
/// </summary>
/// <param name="sessionId">The session identifier.</param>
/// <returns>Task.</returns>
- Task ReportSessionEnded(Guid sessionId);
+ Task ReportSessionEnded(string sessionId);
/// <summary>
/// Gets the session info dto.
@@ -108,7 +109,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendGeneralCommand(Guid controllingSessionId, Guid sessionId, GeneralCommand command, CancellationToken cancellationToken);
+ Task SendGeneralCommand(string controllingSessionId, string sessionId, GeneralCommand command, CancellationToken cancellationToken);
/// <summary>
/// Sends the message command.
@@ -118,7 +119,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendMessageCommand(Guid controllingSessionId, Guid sessionId, MessageCommand command, CancellationToken cancellationToken);
+ Task SendMessageCommand(string controllingSessionId, string sessionId, MessageCommand command, CancellationToken cancellationToken);
/// <summary>
/// Sends the play command.
@@ -128,7 +129,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendPlayCommand(Guid controllingSessionId, Guid sessionId, PlayRequest command, CancellationToken cancellationToken);
+ Task SendPlayCommand(string controllingSessionId, string sessionId, PlayRequest command, CancellationToken cancellationToken);
/// <summary>
/// Sends the browse command.
@@ -138,7 +139,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendBrowseCommand(Guid controllingSessionId, Guid sessionId, BrowseRequest command, CancellationToken cancellationToken);
+ Task SendBrowseCommand(string controllingSessionId, string sessionId, BrowseRequest command, CancellationToken cancellationToken);
/// <summary>
/// Sends the playstate command.
@@ -148,7 +149,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="command">The command.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendPlaystateCommand(Guid controllingSessionId, Guid sessionId, PlaystateRequest command, CancellationToken cancellationToken);
+ Task SendPlaystateCommand(string controllingSessionId, string sessionId, PlaystateRequest command, CancellationToken cancellationToken);
/// <summary>
/// Sends the restart required message.
@@ -176,16 +177,32 @@ namespace MediaBrowser.Controller.Session
/// </summary>
/// <param name="sessionId">The session identifier.</param>
/// <param name="userId">The user identifier.</param>
- void AddAdditionalUser(Guid sessionId, Guid userId);
+ void AddAdditionalUser(string sessionId, Guid userId);
/// <summary>
/// Removes the additional user.
/// </summary>
/// <param name="sessionId">The session identifier.</param>
/// <param name="userId">The user identifier.</param>
- void RemoveAdditionalUser(Guid sessionId, Guid userId);
+ void RemoveAdditionalUser(string sessionId, Guid userId);
/// <summary>
+ /// Reports the now viewing item.
+ /// </summary>
+ /// <param name="sessionId">The session identifier.</param>
+ /// <param name="itemId">The item identifier.</param>
+ /// <param name="context">The context.</param>
+ void ReportNowViewingItem(string sessionId, string itemId, string context);
+
+ /// <summary>
+ /// Reports the now viewing item.
+ /// </summary>
+ /// <param name="sessionId">The session identifier.</param>
+ /// <param name="item">The item.</param>
+ /// <param name="context">The context.</param>
+ void ReportNowViewingItem(string sessionId, BaseItemInfo item, string context);
+
+ /// <summary>
/// Authenticates the new session.
/// </summary>
/// <param name="user">The user.</param>
@@ -203,6 +220,6 @@ namespace MediaBrowser.Controller.Session
/// </summary>
/// <param name="sessionId">The session identifier.</param>
/// <param name="capabilities">The capabilities.</param>
- void ReportCapabilities(Guid sessionId, SessionCapabilities capabilities);
+ void ReportCapabilities(string sessionId, SessionCapabilities capabilities);
}
} \ No newline at end of file
diff --git a/MediaBrowser.Controller/Session/PlaybackInfo.cs b/MediaBrowser.Controller/Session/PlaybackInfo.cs
deleted file mode 100644
index 2e59b6b72..000000000
--- a/MediaBrowser.Controller/Session/PlaybackInfo.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using MediaBrowser.Controller.Entities;
-using System;
-using System.Collections.Generic;
-
-namespace MediaBrowser.Controller.Session
-{
- public class PlaybackInfo
- {
- public PlaybackInfo()
- {
- QueueableMediaTypes = new List<string>();
- }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance can seek.
- /// </summary>
- /// <value><c>true</c> if this instance can seek; otherwise, <c>false</c>.</value>
- public bool CanSeek { get; set; }
-
- /// <summary>
- /// Gets or sets the queueable media types.
- /// </summary>
- /// <value>The queueable media types.</value>
- public List<string> QueueableMediaTypes { get; set; }
-
- /// <summary>
- /// Gets or sets the item.
- /// </summary>
- /// <value>The item.</value>
- public BaseItem Item { get; set; }
-
- /// <summary>
- /// Gets or sets the session id.
- /// </summary>
- /// <value>The session id.</value>
- public Guid SessionId { get; set; }
-
- /// <summary>
- /// Gets or sets the media version identifier.
- /// </summary>
- /// <value>The media version identifier.</value>
- public string MediaSourceId { get; set; }
-
- /// <summary>
- /// Gets or sets the index of the audio stream.
- /// </summary>
- /// <value>The index of the audio stream.</value>
- public int? AudioStreamIndex { get; set; }
-
- /// <summary>
- /// Gets or sets the index of the subtitle stream.
- /// </summary>
- /// <value>The index of the subtitle stream.</value>
- public int? SubtitleStreamIndex { get; set; }
- }
-}
diff --git a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs b/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs
deleted file mode 100644
index 9f82fcdff..000000000
--- a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using MediaBrowser.Controller.Entities;
-using System;
-
-namespace MediaBrowser.Controller.Session
-{
- public class PlaybackProgressInfo
- {
- /// <summary>
- /// Gets or sets the item.
- /// </summary>
- /// <value>The item.</value>
- public BaseItem Item { get; set; }
-
- /// <summary>
- /// Gets or sets the session id.
- /// </summary>
- /// <value>The session id.</value>
- public Guid SessionId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is paused.
- /// </summary>
- /// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value>
- public bool IsPaused { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is muted.
- /// </summary>
- /// <value><c>true</c> if this instance is muted; otherwise, <c>false</c>.</value>
- public bool IsMuted { get; set; }
-
- /// <summary>
- /// Gets or sets the position ticks.
- /// </summary>
- /// <value>The position ticks.</value>
- public long? PositionTicks { get; set; }
-
- /// <summary>
- /// Gets or sets the media version identifier.
- /// </summary>
- /// <value>The media version identifier.</value>
- public string MediaSourceId { get; set; }
-
- /// <summary>
- /// Gets or sets the volume level.
- /// </summary>
- /// <value>The volume level.</value>
- public int? VolumeLevel { get; set; }
-
- /// <summary>
- /// Gets or sets the index of the audio stream.
- /// </summary>
- /// <value>The index of the audio stream.</value>
- public int? AudioStreamIndex { get; set; }
-
- /// <summary>
- /// Gets or sets the index of the subtitle stream.
- /// </summary>
- /// <value>The index of the subtitle stream.</value>
- public int? SubtitleStreamIndex { get; set; }
- }
-}
diff --git a/MediaBrowser.Controller/Session/PlaybackStopInfo.cs b/MediaBrowser.Controller/Session/PlaybackStopInfo.cs
deleted file mode 100644
index 063abf78c..000000000
--- a/MediaBrowser.Controller/Session/PlaybackStopInfo.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using MediaBrowser.Controller.Entities;
-using System;
-
-namespace MediaBrowser.Controller.Session
-{
- public class PlaybackStopInfo
- {
- /// <summary>
- /// Gets or sets the item.
- /// </summary>
- /// <value>The item.</value>
- public BaseItem Item { get; set; }
-
- /// <summary>
- /// Gets or sets the session id.
- /// </summary>
- /// <value>The session id.</value>
- public Guid SessionId { get; set; }
-
- /// <summary>
- /// Gets or sets the position ticks.
- /// </summary>
- /// <value>The position ticks.</value>
- public long? PositionTicks { get; set; }
-
- /// <summary>
- /// Gets or sets the media version identifier.
- /// </summary>
- /// <value>The media version identifier.</value>
- public string MediaSourceId { get; set; }
- }
-}
diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs
index 9fcb024e8..80a6b75a2 100644
--- a/MediaBrowser.Controller/Session/SessionInfo.cs
+++ b/MediaBrowser.Controller/Session/SessionInfo.cs
@@ -1,5 +1,4 @@
-using MediaBrowser.Controller.Entities;
-using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Session;
using System;
using System.Collections.Generic;
@@ -26,8 +25,11 @@ namespace MediaBrowser.Controller.Session
AdditionalUsers = new List<SessionUserInfo>();
SupportedCommands = new List<string>();
+ PlayState = new PlayerStateInfo();
}
+ public PlayerStateInfo PlayState { get; set; }
+
public List<SessionUserInfo> AdditionalUsers { get; set; }
/// <summary>
@@ -37,12 +39,6 @@ namespace MediaBrowser.Controller.Session
public string RemoteEndPoint { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether this instance can seek.
- /// </summary>
- /// <value><c>true</c> if this instance can seek; otherwise, <c>false</c>.</value>
- public bool CanSeek { get; set; }
-
- /// <summary>
/// Gets or sets the queueable media types.
/// </summary>
/// <value>The queueable media types.</value>
@@ -58,7 +54,7 @@ namespace MediaBrowser.Controller.Session
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
- public Guid Id { get; set; }
+ public string Id { get; set; }
/// <summary>
/// Gets or sets the user id.
@@ -97,67 +93,16 @@ namespace MediaBrowser.Controller.Session
public string NowViewingContext { get; set; }
/// <summary>
- /// Gets or sets the type of the now viewing item.
- /// </summary>
- /// <value>The type of the now viewing item.</value>
- public string NowViewingItemType { get; set; }
-
- /// <summary>
- /// Gets or sets the now viewing item identifier.
- /// </summary>
- /// <value>The now viewing item identifier.</value>
- public string NowViewingItemId { get; set; }
-
- /// <summary>
/// Gets or sets the name of the now viewing item.
/// </summary>
/// <value>The name of the now viewing item.</value>
- public string NowViewingItemName { get; set; }
+ public BaseItemInfo NowViewingItem { get; set; }
/// <summary>
/// Gets or sets the now playing item.
/// </summary>
/// <value>The now playing item.</value>
- public BaseItem NowPlayingItem { get; set; }
-
- /// <summary>
- /// Gets or sets the now playing media version identifier.
- /// </summary>
- /// <value>The now playing media version identifier.</value>
- public string NowPlayingMediaSourceId { get; set; }
-
- /// <summary>
- /// Gets or sets the now playing run time ticks.
- /// </summary>
- /// <value>The now playing run time ticks.</value>
- public long? NowPlayingRunTimeTicks { get; set; }
-
- /// <summary>
- /// Gets or sets the now playing position ticks.
- /// </summary>
- /// <value>The now playing position ticks.</value>
- public long? NowPlayingPositionTicks { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether this instance is paused.
- /// </summary>
- /// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value>
- public bool IsPaused { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is muted.
- /// </summary>
- /// <value><c>true</c> if this instance is muted; otherwise, <c>false</c>.</value>
- public bool IsMuted { get; set; }
-
- /// <summary>
- /// Gets or sets the volume level, on a scale of 0-100
- /// </summary>
- /// <value>The volume level.</value>
- public int? VolumeLevel { get; set; }
-
- public int? NowPlayingAudioStreamIndex { get; set; }
-
- public int? NowPlayingSubtitleStreamIndex { get; set; }
+ public BaseItemInfo NowPlayingItem { get; set; }
/// <summary>
/// Gets or sets the device id.