diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-24 11:08:51 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-24 11:08:51 -0400 |
| commit | b49764dbaafbbf11b6308ec675355696b9e58379 (patch) | |
| tree | 58677308bf98c95f1982a84eb403a01241f0a692 /MediaBrowser.Controller | |
| parent | 14c464c28a3b9cac207ef741711e31cef1c15378 (diff) | |
fixes #555 - Have clients report seek and queuing capabilities
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaBrowser.Controller.csproj | 1 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Session/ISessionManager.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Session/PlaybackInfo.cs | 38 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Session/SessionInfo.cs | 13 |
5 files changed, 57 insertions, 7 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 326d30bd76..0f090f587b 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -16,7 +16,6 @@ using System.Linq; using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; -using MoreLinq; namespace MediaBrowser.Controller.Entities { @@ -690,7 +689,7 @@ namespace MediaBrowser.Controller.Entities var options = new ParallelOptions { - MaxDegreeOfParallelism = 20 + MaxDegreeOfParallelism = 10 }; Parallel.ForEach(nonCachedChildren, options, child => @@ -805,7 +804,7 @@ namespace MediaBrowser.Controller.Entities foreach (var tuple in list) { - if (tasks.Count > 8) + if (tasks.Count > 5) { await Task.WhenAll(tasks).ConfigureAwait(false); } diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index f49bd8cf00..80cf82da15 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -165,6 +165,7 @@ <Compile Include="Kernel.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Providers\BaseMetadataProvider.cs" /> + <Compile Include="Session\PlaybackInfo.cs" /> <Compile Include="Session\SessionInfo.cs" /> <Compile Include="Sorting\IBaseItemComparer.cs" /> <Compile Include="Sorting\IUserBaseItemComparer.cs" /> diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 1976c653a6..fba1d26e8b 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -47,11 +47,9 @@ namespace MediaBrowser.Controller.Session /// <summary> /// Used to report that playback has started for an item /// </summary> - /// <param name="item">The item.</param> - /// <param name="sessionId">The session id.</param> + /// <param name="info">The info.</param> /// <returns>Task.</returns> - /// <exception cref="System.ArgumentNullException"></exception> - Task OnPlaybackStart(BaseItem item, Guid sessionId); + Task OnPlaybackStart(PlaybackInfo info); /// <summary> /// Used to report playback progress for an item @@ -59,6 +57,7 @@ namespace MediaBrowser.Controller.Session /// <param name="item">The item.</param> /// <param name="positionTicks">The position ticks.</param> /// <param name="isPaused">if set to <c>true</c> [is paused].</param> + /// <param name="isMuted">if set to <c>true</c> [is muted].</param> /// <param name="sessionId">The session id.</param> /// <returns>Task.</returns> /// <exception cref="System.ArgumentNullException"></exception> diff --git a/MediaBrowser.Controller/Session/PlaybackInfo.cs b/MediaBrowser.Controller/Session/PlaybackInfo.cs new file mode 100644 index 0000000000..ab3111e766 --- /dev/null +++ b/MediaBrowser.Controller/Session/PlaybackInfo.cs @@ -0,0 +1,38 @@ +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; } + } +} diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index 6c0f1a0854..ba6d3d0acd 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -15,9 +15,22 @@ namespace MediaBrowser.Controller.Session public SessionInfo() { WebSockets = new List<IWebSocketConnection>(); + 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 id. /// </summary> /// <value>The id.</value> |
