// The server's job is to maintain a consistent state for clients to reference
// and notify clients of state changes. The actual syncing of media playback
// happens client side. Clients are aware of the server's time and use it to sync.
_logger.LogInformation("HandleRequest: {SessionId} requested {RequestType}, group {GroupId} is {StateType}.",session.Id,request.Type,GroupId.ToString(),_state.Type);
_logger.LogInformation("Session {SessionId} requested {RequestType} in group {GroupId} that is {StateType}.",session.Id,request.Type,GroupId.ToString(),_state.Type);
_logger.LogWarning("JoinGroup: {SessionId} does not have access to some content from the playing queue of group {GroupId}.",session.Id,group.GroupId.ToString());
_logger.LogWarning("Session {SessionId} tried to join group {GroupId} but does not have access to some content of the playing queue.",session.Id,group.GroupId.ToString());
// Reset status of sessions and await for all Ready events.
context.SetAllBuffering(true);
Logger.LogDebug("HandleRequest: {RequestType} in group {GroupId}, {SessionId} set a new play queue.",request.Type,context.GroupId.ToString(),session.Id);
_logger.LogDebug("Session {SessionId} set a new play queue in group {GroupId}.",session.Id,context.GroupId.ToString());
// Reset status of sessions and await for all Ready events.
context.SetAllBuffering(true);
Logger.LogDebug("HandleRequest: {RequestType} in group {GroupId}, waiting for all ready events.",request.Type,context.GroupId.ToString());
_logger.LogDebug("Group {GroupId} is waiting for all ready events.",context.GroupId.ToString());
}
else
{
if(ResumePlaying)
{
Logger.LogDebug("HandleRequest: {RequestType} in group {GroupId}, ignoring sessions that are not ready and forcing the playback to start.",request.Type,context.GroupId.ToString());
_logger.LogDebug("Forcing the playback to start in group {GroupId}. Group-wait is disabled until next state change.",context.GroupId.ToString());
// An Unpause request is forcing the playback to start, ignoring sessions that are not ready.
Logger.LogDebug("HandleRequest: {RequestType} in group {GroupId}, {SessionId} has wrong playlist item.",request.Type,context.GroupId.ToString(),session.Id);
_logger.LogDebug("Session {SessionId} reported wrong playlist item in group {GroupId}.",session.Id,context.GroupId.ToString());
Logger.LogDebug("HandleRequest: {RequestType} in group {GroupId}, {SessionId} has wrong playlist item.",request.Type,context.GroupId.ToString(),session.Id);
_logger.LogDebug("Session {SessionId} reported wrong playlist item in group {GroupId}.",session.Id,context.GroupId.ToString());
Logger.LogWarning("HandleRequest: {RequestType} in group {GroupId}, {SessionId} is not time syncing properly. Ignoring elapsed time.",request.Type,context.GroupId.ToString(),session.Id);
_logger.LogWarning("Session {SessionId} is not time syncing properly. Ignoring elapsed time.",session.Id);
Logger.LogDebug("HandleRequest: {RequestType} in group {GroupId}, {SessionId} at {PositionTicks} (delay of {Delay} seconds).",request.Type,context.GroupId.ToString(),session.Id,clientPosition,TimeSpan.FromTicks(delayTicks).TotalSeconds);
_logger.LogDebug("Session {SessionId} is at {PositionTicks} (delay of {Delay} seconds) in group {GroupId}.",session.Id,clientPosition,TimeSpan.FromTicks(delayTicks).TotalSeconds,context.GroupId.ToString());
Logger.LogWarning("HandleRequest: {RequestType} in group {GroupId}, {SessionId} got lost in time, correcting.",request.Type,context.GroupId.ToString(),session.Id);
_logger.LogWarning("Session {SessionId} got lost in time, correcting.",session.Id);
Logger.LogInformation("HandleRequest: {RequestType} in group {GroupId}, others still buffering, {SessionId} will pause when ready in {Delay} seconds.",request.Type,context.GroupId.ToString(),session.Id,TimeSpan.FromTicks(delayTicks).TotalSeconds);
_logger.LogInformation("Session {SessionId} will pause when ready in {Delay} seconds. Group {GroupId} is waiting for all ready events.",session.Id,TimeSpan.FromTicks(delayTicks).TotalSeconds,context.GroupId.ToString());
Logger.LogInformation("HandleRequest: {RequestType} in group {GroupId}, {SessionId} is recovering, notifying others to resume in {Delay} seconds.",request.Type,context.GroupId.ToString(),session.Id,TimeSpan.FromTicks(delayTicks).TotalSeconds);
_logger.LogInformation("Session {SessionId} is recovering, group {GroupId} will resume in {Delay} seconds.",session.Id,context.GroupId.ToString(),TimeSpan.FromTicks(delayTicks).TotalSeconds);
Logger.LogWarning("HandleRequest: {RequestType} in group {GroupId}, {SessionId} resumed playback but did not update others in time. {Delay} seconds to recover.",request.Type,context.GroupId.ToString(),session.Id,TimeSpan.FromTicks(delayTicks).TotalSeconds);
_logger.LogWarning("Session {SessionId} resumed playback, group {GroupId} has {Delay} seconds to recover.",session.Id,context.GroupId.ToString(),TimeSpan.FromTicks(delayTicks).TotalSeconds);
Logger.LogWarning("HandleRequest: {RequestType} in group {GroupId}, {SessionId} is seeking to wrong position, correcting.",request.Type,context.GroupId.ToString(),session.Id);
_logger.LogWarning("Session {SessionId} is seeking to wrong position, correcting.",session.Id);
Logger.LogDebug("HandleRequest: {RequestType} in group {GroupId}, {SessionId} is ready, returning to previous state.",request.Type,context.GroupId.ToString(),session.Id);
Logger.LogDebug("HandleRequest: {RequestType} in group {GroupId}, {SessionId} provided the wrong playlist identifier.",request.Type,context.GroupId.ToString(),session.Id);
_logger.LogDebug("Session {SessionId} provided the wrong playlist item for group {GroupId}.",session.Id,context.GroupId.ToString());
Logger.LogDebug("HandleRequest: {RequestType} in group {GroupId}, {SessionId} provided the wrong playlist identifier.",request.Type,context.GroupId.ToString(),session.Id);
_logger.LogDebug("Session {SessionId} provided the wrong playlist item for group {GroupId}.",session.Id,context.GroupId.ToString());