mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 14:28:46 +01:00
fixes #555 - Have clients report seek and queuing capabilities
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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>
|
||||
|
||||
38
MediaBrowser.Controller/Session/PlaybackInfo.cs
Normal file
38
MediaBrowser.Controller/Session/PlaybackInfo.cs
Normal file
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,21 @@ 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>
|
||||
|
||||
Reference in New Issue
Block a user