aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/SyncPlay
diff options
context:
space:
mode:
authorIonut Andrei Oanca <oancaionutandrei@gmail.com>2020-10-21 16:42:57 +0200
committerIonut Andrei Oanca <oancaionutandrei@gmail.com>2020-10-21 16:42:57 +0200
commit36fee4e60a033d8d785e62788aaf00999d497c58 (patch)
treed027211df6ba4f4991967831d38eccb954a4365b /Emby.Server.Implementations/SyncPlay
parent93cbf64f884688b667c5403412cb8193dadb251c (diff)
Minor fixes
Diffstat (limited to 'Emby.Server.Implementations/SyncPlay')
-rw-r--r--Emby.Server.Implementations/SyncPlay/GroupController.cs6
-rw-r--r--Emby.Server.Implementations/SyncPlay/GroupStates/PausedGroupState.cs2
-rw-r--r--Emby.Server.Implementations/SyncPlay/GroupStates/WaitingGroupState.cs20
3 files changed, 14 insertions, 14 deletions
diff --git a/Emby.Server.Implementations/SyncPlay/GroupController.cs b/Emby.Server.Implementations/SyncPlay/GroupController.cs
index ff1340e46..26972de8a 100644
--- a/Emby.Server.Implementations/SyncPlay/GroupController.cs
+++ b/Emby.Server.Implementations/SyncPlay/GroupController.cs
@@ -129,7 +129,7 @@ namespace Emby.Server.Implementations.SyncPlay
/// <summary>
/// Checks if a session is in this group.
/// </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>
private bool ContainsSession(string sessionId)
{
@@ -509,7 +509,7 @@ namespace Emby.Server.Implementations.SyncPlay
return false;
}
- // Check is participants can access the new playing queue.
+ // Check if participants can access the new playing queue.
if (!AllUsersHaveAccessToQueue(playQueue))
{
return false;
@@ -583,7 +583,7 @@ namespace Emby.Server.Implementations.SyncPlay
return false;
}
- // Check is participants can access the new playing queue.
+ // Check if participants can access the new playing queue.
if (!AllUsersHaveAccessToQueue(newItems))
{
return false;
diff --git a/Emby.Server.Implementations/SyncPlay/GroupStates/PausedGroupState.cs b/Emby.Server.Implementations/SyncPlay/GroupStates/PausedGroupState.cs
index f674ec777..8c4bd20b1 100644
--- a/Emby.Server.Implementations/SyncPlay/GroupStates/PausedGroupState.cs
+++ b/Emby.Server.Implementations/SyncPlay/GroupStates/PausedGroupState.cs
@@ -72,7 +72,7 @@ namespace MediaBrowser.Controller.SyncPlay
context.LastActivity = currentTime;
// Seek only if playback actually started.
// 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);
context.SendCommand(session, SyncPlayBroadcastType.AllGroup, command, cancellationToken);
diff --git a/Emby.Server.Implementations/SyncPlay/GroupStates/WaitingGroupState.cs b/Emby.Server.Implementations/SyncPlay/GroupStates/WaitingGroupState.cs
index acf0161b4..ff1d379d7 100644
--- a/Emby.Server.Implementations/SyncPlay/GroupStates/WaitingGroupState.cs
+++ b/Emby.Server.Implementations/SyncPlay/GroupStates/WaitingGroupState.cs
@@ -61,7 +61,7 @@ namespace MediaBrowser.Controller.SyncPlay
context.LastActivity = currentTime;
// Seek only if playback actually started.
// 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.
@@ -151,7 +151,7 @@ namespace MediaBrowser.Controller.SyncPlay
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
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);
_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);
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);
}
else
@@ -221,7 +221,7 @@ namespace MediaBrowser.Controller.SyncPlay
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
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);
_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);
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);
// Notify relevant state change event.
@@ -355,7 +355,7 @@ namespace MediaBrowser.Controller.SyncPlay
var currentTime = DateTime.UtcNow;
var elapsedTime = currentTime - context.LastActivity;
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.
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.
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;
}
@@ -571,7 +571,7 @@ namespace MediaBrowser.Controller.SyncPlay
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
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);
}
else
@@ -612,7 +612,7 @@ namespace MediaBrowser.Controller.SyncPlay
// Make sure the client knows the playing item, to avoid duplicate requests.
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;
}
@@ -624,7 +624,7 @@ namespace MediaBrowser.Controller.SyncPlay
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
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);
}
else