Minor fixes
This commit is contained in:
parent
93cbf64f88
commit
36fee4e60a
|
@ -129,7 +129,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if a session is in this group.
|
/// Checks if a session is in this group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sessionId">The session id to check.</param>
|
/// <param name="sessionId">The session identifier to check.</param>
|
||||||
/// <returns><c>true</c> if the session is in this group; <c>false</c> otherwise.</returns>
|
/// <returns><c>true</c> if the session is in this group; <c>false</c> otherwise.</returns>
|
||||||
private bool ContainsSession(string sessionId)
|
private bool ContainsSession(string sessionId)
|
||||||
{
|
{
|
||||||
|
@ -509,7 +509,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check is participants can access the new playing queue.
|
// Check if participants can access the new playing queue.
|
||||||
if (!AllUsersHaveAccessToQueue(playQueue))
|
if (!AllUsersHaveAccessToQueue(playQueue))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -583,7 +583,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check is participants can access the new playing queue.
|
// Check if participants can access the new playing queue.
|
||||||
if (!AllUsersHaveAccessToQueue(newItems))
|
if (!AllUsersHaveAccessToQueue(newItems))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
context.LastActivity = currentTime;
|
context.LastActivity = currentTime;
|
||||||
// Seek only if playback actually started.
|
// Seek only if playback actually started.
|
||||||
// Pause request may be issued during the delay added to account for latency.
|
// Pause request may be issued during the delay added to account for latency.
|
||||||
context.PositionTicks += elapsedTime.Ticks > 0 ? elapsedTime.Ticks : 0;
|
context.PositionTicks += Math.Max(elapsedTime.Ticks, 0);
|
||||||
|
|
||||||
var command = context.NewSyncPlayCommand(SendCommandType.Pause);
|
var command = context.NewSyncPlayCommand(SendCommandType.Pause);
|
||||||
context.SendCommand(session, SyncPlayBroadcastType.AllGroup, command, cancellationToken);
|
context.SendCommand(session, SyncPlayBroadcastType.AllGroup, command, cancellationToken);
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
context.LastActivity = currentTime;
|
context.LastActivity = currentTime;
|
||||||
// Seek only if playback actually started.
|
// Seek only if playback actually started.
|
||||||
// Event may happen during the delay added to account for latency.
|
// Event may happen during the delay added to account for latency.
|
||||||
context.PositionTicks += elapsedTime.Ticks > 0 ? elapsedTime.Ticks : 0;
|
context.PositionTicks += Math.Max(elapsedTime.Ticks, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare new session.
|
// Prepare new session.
|
||||||
|
@ -151,7 +151,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
||||||
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
||||||
|
|
||||||
// Reset status of sessions and await for all Ready events before sending Play command.
|
// Reset status of sessions and await for all Ready events.
|
||||||
context.SetAllBuffering(true);
|
context.SetAllBuffering(true);
|
||||||
|
|
||||||
_logger.LogDebug("HandleRequest: {0} in group {1}, {2} set a new play queue.", request.GetRequestType(), context.GroupId.ToString(), session.Id.ToString());
|
_logger.LogDebug("HandleRequest: {0} in group {1}, {2} set a new play queue.", request.GetRequestType(), context.GroupId.ToString(), session.Id.ToString());
|
||||||
|
@ -176,7 +176,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
||||||
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
||||||
|
|
||||||
// Reset status of sessions and await for all Ready events before sending Play command.
|
// Reset status of sessions and await for all Ready events.
|
||||||
context.SetAllBuffering(true);
|
context.SetAllBuffering(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -221,7 +221,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
||||||
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
||||||
|
|
||||||
// Reset status of sessions and await for all Ready events before sending Play command.
|
// Reset status of sessions and await for all Ready events.
|
||||||
context.SetAllBuffering(true);
|
context.SetAllBuffering(true);
|
||||||
|
|
||||||
_logger.LogDebug("HandleRequest: {0} in group {1}, waiting for all ready events.", request.GetRequestType(), context.GroupId.ToString());
|
_logger.LogDebug("HandleRequest: {0} in group {1}, waiting for all ready events.", request.GetRequestType(), context.GroupId.ToString());
|
||||||
|
@ -314,7 +314,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
var command = context.NewSyncPlayCommand(SendCommandType.Seek);
|
var command = context.NewSyncPlayCommand(SendCommandType.Seek);
|
||||||
context.SendCommand(session, SyncPlayBroadcastType.AllGroup, command, cancellationToken);
|
context.SendCommand(session, SyncPlayBroadcastType.AllGroup, command, cancellationToken);
|
||||||
|
|
||||||
// Reset status of sessions and await for all Ready events before sending Play command.
|
// Reset status of sessions and await for all Ready events.
|
||||||
context.SetAllBuffering(true);
|
context.SetAllBuffering(true);
|
||||||
|
|
||||||
// Notify relevant state change event.
|
// Notify relevant state change event.
|
||||||
|
@ -355,7 +355,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
var currentTime = DateTime.UtcNow;
|
var currentTime = DateTime.UtcNow;
|
||||||
var elapsedTime = currentTime - context.LastActivity;
|
var elapsedTime = currentTime - context.LastActivity;
|
||||||
context.LastActivity = currentTime;
|
context.LastActivity = currentTime;
|
||||||
context.PositionTicks += elapsedTime.Ticks > 0 ? elapsedTime.Ticks : 0;
|
context.PositionTicks += Math.Max(elapsedTime.Ticks, 0);
|
||||||
|
|
||||||
// Send pause command to all non-buffering sessions.
|
// Send pause command to all non-buffering sessions.
|
||||||
var command = context.NewSyncPlayCommand(SendCommandType.Pause);
|
var command = context.NewSyncPlayCommand(SendCommandType.Pause);
|
||||||
|
@ -559,7 +559,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
// Make sure the client knows the playing item, to avoid duplicate requests.
|
// Make sure the client knows the playing item, to avoid duplicate requests.
|
||||||
if (!request.PlaylistItemId.Equals(context.PlayQueue.GetPlayingItemPlaylistId()))
|
if (!request.PlaylistItemId.Equals(context.PlayQueue.GetPlayingItemPlaylistId()))
|
||||||
{
|
{
|
||||||
_logger.LogDebug("HandleRequest: {0} in group {1}, client provided the wrong playlist id.", request.GetRequestType(), context.GroupId.ToString());
|
_logger.LogDebug("HandleRequest: {0} in group {1}, client provided the wrong playlist identifier.", request.GetRequestType(), context.GroupId.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
||||||
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
||||||
|
|
||||||
// Reset status of sessions and await for all Ready events before sending Play command.
|
// Reset status of sessions and await for all Ready events.
|
||||||
context.SetAllBuffering(true);
|
context.SetAllBuffering(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -612,7 +612,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
// Make sure the client knows the playing item, to avoid duplicate requests.
|
// Make sure the client knows the playing item, to avoid duplicate requests.
|
||||||
if (!request.PlaylistItemId.Equals(context.PlayQueue.GetPlayingItemPlaylistId()))
|
if (!request.PlaylistItemId.Equals(context.PlayQueue.GetPlayingItemPlaylistId()))
|
||||||
{
|
{
|
||||||
_logger.LogDebug("HandleRequest: {0} in group {1}, client provided the wrong playlist id.", request.GetRequestType(), context.GroupId.ToString());
|
_logger.LogDebug("HandleRequest: {0} in group {1}, client provided the wrong playlist identifier.", request.GetRequestType(), context.GroupId.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
||||||
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
||||||
|
|
||||||
// Reset status of sessions and await for all Ready events before sending Play command.
|
// Reset status of sessions and await for all Ready events.
|
||||||
context.SetAllBuffering(true);
|
context.SetAllBuffering(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the group is empty.
|
/// Checks if the group is empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>If the group is empty.</returns>
|
/// <returns><c>true</c> if the group is empty, <c>false</c> otherwise</returns>
|
||||||
bool IsGroupEmpty();
|
bool IsGroupEmpty();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
/// Adds the session to a group.
|
/// Adds the session to a group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="session">The session.</param>
|
/// <param name="session">The session.</param>
|
||||||
/// <param name="groupId">The group id.</param>
|
/// <param name="groupId">The group identifier.</param>
|
||||||
/// <param name="request">The request.</param>
|
/// <param name="request">The request.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
void JoinGroup(SessionInfo session, Guid groupId, JoinGroupRequest request, CancellationToken cancellationToken);
|
void JoinGroup(SessionInfo session, Guid groupId, JoinGroupRequest request, CancellationToken cancellationToken);
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
GroupState GetGroupState();
|
GroupState GetGroupState();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle a session that joined the group.
|
/// Handles a session that joined the group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context">The context of the state.</param>
|
/// <param name="context">The context of the state.</param>
|
||||||
/// <param name="prevState">The previous state.</param>
|
/// <param name="prevState">The previous state.</param>
|
||||||
|
@ -25,7 +25,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
void SessionJoined(ISyncPlayStateContext context, GroupState prevState, SessionInfo session, CancellationToken cancellationToken);
|
void SessionJoined(ISyncPlayStateContext context, GroupState prevState, SessionInfo session, CancellationToken cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle a session that is leaving the group.
|
/// Handles a session that is leaving the group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context">The context of the state.</param>
|
/// <param name="context">The context of the state.</param>
|
||||||
/// <param name="prevState">The previous state.</param>
|
/// <param name="prevState">The previous state.</param>
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
/// Builds a new playback command with some default values.
|
/// Builds a new playback command with some default values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type">The command type.</param>
|
/// <param name="type">The command type.</param>
|
||||||
/// <returns>The SendCommand.</returns>
|
/// <returns>The command.</returns>
|
||||||
SendCommand NewSyncPlayCommand(SendCommandType type);
|
SendCommand NewSyncPlayCommand(SendCommandType type);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -79,7 +79,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type">The update type.</param>
|
/// <param name="type">The update type.</param>
|
||||||
/// <param name="data">The data to send.</param>
|
/// <param name="data">The data to send.</param>
|
||||||
/// <returns>The GroupUpdate.</returns>
|
/// <returns>The group update.</returns>
|
||||||
GroupUpdate<T> NewSyncPlayGroupUpdate<T>(GroupUpdateType type, T data);
|
GroupUpdate<T> NewSyncPlayGroupUpdate<T>(GroupUpdateType type, T data);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -93,7 +93,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
/// Sanitizes the PositionTicks, considers the current playing item when available.
|
/// Sanitizes the PositionTicks, considers the current playing item when available.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="positionTicks">The PositionTicks.</param>
|
/// <param name="positionTicks">The PositionTicks.</param>
|
||||||
/// <returns>The sanitized PositionTicks.</returns>
|
/// <returns>The sanitized position ticks.</returns>
|
||||||
long SanitizePositionTicks(long? positionTicks);
|
long SanitizePositionTicks(long? positionTicks);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -141,14 +141,14 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
/// <param name="playQueue">The new play queue.</param>
|
/// <param name="playQueue">The new play queue.</param>
|
||||||
/// <param name="playingItemPosition">The playing item position in the play queue.</param>
|
/// <param name="playingItemPosition">The playing item position in the play queue.</param>
|
||||||
/// <param name="startPositionTicks">The start position ticks.</param>
|
/// <param name="startPositionTicks">The start position ticks.</param>
|
||||||
/// <returns><c>true</c> if the play queue has been changed; <c>false</c> is something went wrong.</returns>
|
/// <returns><c>true</c> if the play queue has been changed; <c>false</c> if something went wrong.</returns>
|
||||||
bool SetPlayQueue(Guid[] playQueue, int playingItemPosition, long startPositionTicks);
|
bool SetPlayQueue(Guid[] playQueue, int playingItemPosition, long startPositionTicks);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the playing item.
|
/// Sets the playing item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="playlistItemId">The new playing item id.</param>
|
/// <param name="playlistItemId">The new playing item identifier.</param>
|
||||||
/// <returns><c>true</c> if the play queue has been changed; <c>false</c> is something went wrong.</returns>
|
/// <returns><c>true</c> if the play queue has been changed; <c>false</c> if something went wrong.</returns>
|
||||||
bool SetPlayingItem(string playlistItemId);
|
bool SetPlayingItem(string playlistItemId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -161,9 +161,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves an item in the play queue.
|
/// Moves an item in the play queue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="playlistItemId">The playlist id of the item to move.</param>
|
/// <param name="playlistItemId">The playlist identifier of the item to move.</param>
|
||||||
/// <param name="newIndex">The new position.</param>
|
/// <param name="newIndex">The new position.</param>
|
||||||
/// <returns><c>true</c> if item has been moved; <c>false</c> is something went wrong.</returns>
|
/// <returns><c>true</c> if item has been moved; <c>false</c> if something went wrong.</returns>
|
||||||
bool MoveItemInPlayQueue(string playlistItemId, int newIndex);
|
bool MoveItemInPlayQueue(string playlistItemId, int newIndex);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -171,7 +171,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newItems">The new items to add to the play queue.</param>
|
/// <param name="newItems">The new items to add to the play queue.</param>
|
||||||
/// <param name="mode">The mode with which the items will be added.</param>
|
/// <param name="mode">The mode with which the items will be added.</param>
|
||||||
/// <returns><c>true</c> if the play queue has been changed; <c>false</c> is something went wrong.</returns>
|
/// <returns><c>true</c> if the play queue has been changed; <c>false</c> if something went wrong.</returns>
|
||||||
bool AddToPlayQueue(Guid[] newItems, string mode);
|
bool AddToPlayQueue(Guid[] newItems, string mode);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -6,7 +6,7 @@ using MediaBrowser.Controller.Session;
|
||||||
namespace MediaBrowser.Controller.SyncPlay
|
namespace MediaBrowser.Controller.SyncPlay
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class BufferingGroupRequest.
|
/// Class BufferGroupRequest.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BufferGroupRequest : IPlaybackGroupRequest
|
public class BufferGroupRequest : IPlaybackGroupRequest
|
||||||
{
|
{
|
||||||
|
@ -29,9 +29,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
public bool IsPlaying { get; set; }
|
public bool IsPlaying { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the playlist item id of the playing item.
|
/// Gets or sets the playlist item identifier of the playing item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The playlist item id.</value>
|
/// <value>The playlist item identifier.</value>
|
||||||
public string PlaylistItemId { get; set; }
|
public string PlaylistItemId { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
public class MovePlaylistItemGroupRequest : IPlaybackGroupRequest
|
public class MovePlaylistItemGroupRequest : IPlaybackGroupRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the playlist id of the item.
|
/// Gets or sets the playlist identifier of the item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The playlist id of the item.</value>
|
/// <value>The playlist identifier of the item.</value>
|
||||||
public string PlaylistItemId { get; set; }
|
public string PlaylistItemId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public PlaybackRequestType GetRequestType()
|
public PlaybackRequestType GetRequestType()
|
||||||
{
|
{
|
||||||
return PlaybackRequestType.Queue;
|
return PlaybackRequestType.MovePlaylistItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
public class NextTrackGroupRequest : IPlaybackGroupRequest
|
public class NextTrackGroupRequest : IPlaybackGroupRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the playing item id.
|
/// Gets or sets the playing item identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The playing item id.</value>
|
/// <value>The playing item identifier.</value>
|
||||||
public string PlaylistItemId { get; set; }
|
public string PlaylistItemId { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
@ -5,7 +5,7 @@ using MediaBrowser.Controller.Session;
|
||||||
namespace MediaBrowser.Controller.SyncPlay
|
namespace MediaBrowser.Controller.SyncPlay
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class UpdatePingGroupRequest.
|
/// Class PingGroupRequest.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PingGroupRequest : IPlaybackGroupRequest
|
public class PingGroupRequest : IPlaybackGroupRequest
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
public class PreviousTrackGroupRequest : IPlaybackGroupRequest
|
public class PreviousTrackGroupRequest : IPlaybackGroupRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the playing item id.
|
/// Gets or sets the playing item identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The playing item id.</value>
|
/// <value>The playing item identifier.</value>
|
||||||
public string PlaylistItemId { get; set; }
|
public string PlaylistItemId { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
@ -6,7 +6,7 @@ using MediaBrowser.Controller.Session;
|
||||||
namespace MediaBrowser.Controller.SyncPlay
|
namespace MediaBrowser.Controller.SyncPlay
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class BufferingDoneGroupRequest.
|
/// Class ReadyGroupRequest.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ReadyGroupRequest : IPlaybackGroupRequest
|
public class ReadyGroupRequest : IPlaybackGroupRequest
|
||||||
{
|
{
|
||||||
|
@ -29,9 +29,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
public bool IsPlaying { get; set; }
|
public bool IsPlaying { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the playlist item id of the playing item.
|
/// Gets or sets the playlist item identifier of the playing item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The playlist item id.</value>
|
/// <value>The playlist item identifier.</value>
|
||||||
public string PlaylistItemId { get; set; }
|
public string PlaylistItemId { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
@ -10,15 +10,15 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
public class RemoveFromPlaylistGroupRequest : IPlaybackGroupRequest
|
public class RemoveFromPlaylistGroupRequest : IPlaybackGroupRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the playlist ids ot the items.
|
/// Gets or sets the playlist identifiers ot the items.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The playlist ids ot the items.</value>
|
/// <value>The playlist identifiers ot the items.</value>
|
||||||
public string[] PlaylistItemIds { get; set; }
|
public string[] PlaylistItemIds { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public PlaybackRequestType GetRequestType()
|
public PlaybackRequestType GetRequestType()
|
||||||
{
|
{
|
||||||
return PlaybackRequestType.Queue;
|
return PlaybackRequestType.RemoveFromPlaylist;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
public class SetPlaylistItemGroupRequest : IPlaybackGroupRequest
|
public class SetPlaylistItemGroupRequest : IPlaybackGroupRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the playlist id of the playing item.
|
/// Gets or sets the playlist identifier of the playing item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The playlist id of the playing item.</value>
|
/// <value>The playlist identifier of the playing item.</value>
|
||||||
public string PlaylistItemId { get; set; }
|
public string PlaylistItemId { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
@ -64,9 +64,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
public GroupRepeatMode RepeatMode { get; private set; } = GroupRepeatMode.RepeatNone;
|
public GroupRepeatMode RepeatMode { get; private set; } = GroupRepeatMode.RepeatNone;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the progressive id counter.
|
/// Gets or sets the progressive identifier counter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The progressive id.</value>
|
/// <value>The progressive identifier.</value>
|
||||||
private int ProgressiveId { get; set; } = 0;
|
private int ProgressiveId { get; set; } = 0;
|
||||||
|
|
||||||
private bool _disposed = false;
|
private bool _disposed = false;
|
||||||
|
@ -101,15 +101,15 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the next available id.
|
/// Gets the next available identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The next available id.</returns>
|
/// <returns>The next available identifier.</returns>
|
||||||
private int GetNextProgressiveId() {
|
private int GetNextProgressiveId() {
|
||||||
return ProgressiveId++;
|
return ProgressiveId++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a list from the array of items. Each item is given an unique playlist id.
|
/// Creates a list from the array of items. Each item is given an unique playlist identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The list of queue items.</returns>
|
/// <returns>The list of queue items.</returns>
|
||||||
private List<QueueItem> CreateQueueItemsFromArray(Guid[] items)
|
private List<QueueItem> CreateQueueItemsFromArray(Guid[] items)
|
||||||
|
@ -276,9 +276,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets playlist id of the playing item, if any.
|
/// Gets playlist identifier of the playing item, if any.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The playlist id of the playing item.</returns>
|
/// <returns>The playlist identifier of the playing item.</returns>
|
||||||
public string GetPlayingItemPlaylistId()
|
public string GetPlayingItemPlaylistId()
|
||||||
{
|
{
|
||||||
if (PlayingItemIndex < 0)
|
if (PlayingItemIndex < 0)
|
||||||
|
@ -299,9 +299,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the playing item id, if any.
|
/// Gets the playing item identifier, if any.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The playing item id.</returns>
|
/// <returns>The playing item identifier.</returns>
|
||||||
public Guid GetPlayingItemId()
|
public Guid GetPlayingItemId()
|
||||||
{
|
{
|
||||||
if (PlayingItemIndex < 0)
|
if (PlayingItemIndex < 0)
|
||||||
|
@ -322,9 +322,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the playing item using its id. If not in the playlist, the playing item is reset.
|
/// Sets the playing item using its identifier. If not in the playlist, the playing item is reset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="itemId">The new playing item id.</param>
|
/// <param name="itemId">The new playing item identifier.</param>
|
||||||
public void SetPlayingItemById(Guid itemId)
|
public void SetPlayingItemById(Guid itemId)
|
||||||
{
|
{
|
||||||
var itemIds = GetPlaylistAsList().Select(queueItem => queueItem.ItemId).ToList();
|
var itemIds = GetPlaylistAsList().Select(queueItem => queueItem.ItemId).ToList();
|
||||||
|
@ -333,9 +333,9 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the playing item using its playlist id. If not in the playlist, the playing item is reset.
|
/// Sets the playing item using its playlist identifier. If not in the playlist, the playing item is reset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="playlistItemId">The new playing item id.</param>
|
/// <param name="playlistItemId">The new playing item identifier.</param>
|
||||||
/// <returns><c>true</c> if playing item has been set; <c>false</c> if item is not in the playlist.</returns>
|
/// <returns><c>true</c> if playing item has been set; <c>false</c> if item is not in the playlist.</returns>
|
||||||
public bool SetPlayingItemByPlaylistId(string playlistItemId)
|
public bool SetPlayingItemByPlaylistId(string playlistItemId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace MediaBrowser.Model.SyncPlay
|
||||||
StateUpdate,
|
StateUpdate,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The play-queue update. Tells a user what's the playing queue of the group.
|
/// The play-queue update. Tells a user the playing queue of the group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PlayQueue,
|
PlayQueue,
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ namespace MediaBrowser.Model.SyncPlay
|
||||||
public class JoinGroupRequest
|
public class JoinGroupRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the group id.
|
/// Gets or sets the group identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The id of the group to join.</value>
|
/// <value>The identifier of the group to join.</value>
|
||||||
public Guid GroupId { get; set; }
|
public Guid GroupId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,15 +10,15 @@ namespace MediaBrowser.Model.SyncPlay
|
||||||
public class QueueItem
|
public class QueueItem
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the item id.
|
/// Gets or sets the item identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The item id.</value>
|
/// <value>The item identifier.</value>
|
||||||
public Guid ItemId { get; set; }
|
public Guid ItemId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the playlist id of the item.
|
/// Gets or sets the playlist identifier of the item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The playlist id of the item.</value>
|
/// <value>The playlist identifier of the item.</value>
|
||||||
public string PlaylistItemId { get; set; }
|
public string PlaylistItemId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,9 @@ namespace MediaBrowser.Model.SyncPlay
|
||||||
public string GroupId { get; set; }
|
public string GroupId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the playlist id of the playing item.
|
/// Gets or sets the playlist identifier of the playing item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The playlist id of the playing item.</value>
|
/// <value>The playlist identifier of the playing item.</value>
|
||||||
public string PlaylistItemId { get; set; }
|
public string PlaylistItemId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user