diff options
| author | gion <oancaionutandrei@gmail.com> | 2020-04-04 17:56:21 +0200 |
|---|---|---|
| committer | gion <oancaionutandrei@gmail.com> | 2020-04-27 22:07:33 +0200 |
| commit | f273995f5bd89f12322d80f3009ad6d8d20b8e81 (patch) | |
| tree | cad35bd925eba40024b04e3840dfda57b0c9ad6c /MediaBrowser.Controller | |
| parent | b3354ec6374e2491679c699aaff8ee407dd0ac7c (diff) | |
Refactor: rename user to session
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Syncplay/GroupInfo.cs | 62 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Syncplay/ISyncplayController.cs | 24 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Syncplay/ISyncplayManager.cs | 40 |
3 files changed, 63 insertions, 63 deletions
diff --git a/MediaBrowser.Controller/Syncplay/GroupInfo.cs b/MediaBrowser.Controller/Syncplay/GroupInfo.cs index d37e8563bc..42e85ef864 100644 --- a/MediaBrowser.Controller/Syncplay/GroupInfo.cs +++ b/MediaBrowser.Controller/Syncplay/GroupInfo.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Syncplay public class GroupInfo { /// <summary> - /// Default ping value used for users. + /// Default ping value used for sessions. /// </summary> public readonly long DefaulPing = 500; /// <summary> @@ -53,85 +53,85 @@ namespace MediaBrowser.Controller.Syncplay new ConcurrentDictionary<string, GroupMember>(StringComparer.OrdinalIgnoreCase); /// <summary> - /// Checks if a user is in this group. + /// Checks if a session is in this group. /// </summary> - /// <value><c>true</c> if the user is in this group; <c>false</c> otherwise.</value> - public bool ContainsUser(string sessionId) + /// <value><c>true</c> if the session is in this group; <c>false</c> otherwise.</value> + public bool ContainsSession(string sessionId) { return Partecipants.ContainsKey(sessionId); } /// <summary> - /// Adds the user to the group. + /// Adds the session to the group. /// </summary> - /// <param name="user">The session.</param> - public void AddUser(SessionInfo user) + /// <param name="session">The session.</param> + public void AddSession(SessionInfo session) { - if (ContainsUser(user.Id.ToString())) return; + if (ContainsSession(session.Id.ToString())) return; var member = new GroupMember(); - member.Session = user; + member.Session = session; member.Ping = DefaulPing; member.IsBuffering = false; - Partecipants[user.Id.ToString()] = member; + Partecipants[session.Id.ToString()] = member; } /// <summary> - /// Removes the user from the group. + /// Removes the session from the group. /// </summary> - /// <param name="user">The session.</param> + /// <param name="session">The session.</param> - public void RemoveUser(SessionInfo user) + public void RemoveSession(SessionInfo session) { - if (!ContainsUser(user.Id.ToString())) return; + if (!ContainsSession(session.Id.ToString())) return; GroupMember member; - Partecipants.Remove(user.Id.ToString(), out member); + Partecipants.Remove(session.Id.ToString(), out member); } /// <summary> - /// Updates the ping of a user. + /// Updates the ping of a session. /// </summary> - /// <param name="user">The session.</param> + /// <param name="session">The session.</param> /// <param name="ping">The ping.</param> - public void UpdatePing(SessionInfo user, long ping) + public void UpdatePing(SessionInfo session, long ping) { - if (!ContainsUser(user.Id.ToString())) return; - Partecipants[user.Id.ToString()].Ping = ping; + if (!ContainsSession(session.Id.ToString())) return; + Partecipants[session.Id.ToString()].Ping = ping; } /// <summary> /// Gets the highest ping in the group. /// </summary> - /// <value name="user">The highest ping in the group.</value> + /// <value name="session">The highest ping in the group.</value> public long GetHighestPing() { long max = Int64.MinValue; - foreach (var user in Partecipants.Values) + foreach (var session in Partecipants.Values) { - max = Math.Max(max, user.Ping); + max = Math.Max(max, session.Ping); } return max; } /// <summary> - /// Sets the user's buffering state. + /// Sets the session's buffering state. /// </summary> - /// <param name="user">The session.</param> + /// <param name="session">The session.</param> /// <param name="isBuffering">The state.</param> - public void SetBuffering(SessionInfo user, bool isBuffering) + public void SetBuffering(SessionInfo session, bool isBuffering) { - if (!ContainsUser(user.Id.ToString())) return; - Partecipants[user.Id.ToString()].IsBuffering = isBuffering; + if (!ContainsSession(session.Id.ToString())) return; + Partecipants[session.Id.ToString()].IsBuffering = isBuffering; } /// <summary> /// Gets the group buffering state. /// </summary> - /// <value><c>true</c> if there is a user buffering in the group; <c>false</c> otherwise.</value> + /// <value><c>true</c> if there is a session buffering in the group; <c>false</c> otherwise.</value> public bool IsBuffering() { - foreach (var user in Partecipants.Values) + foreach (var session in Partecipants.Values) { - if (user.IsBuffering) return true; + if (session.IsBuffering) return true; } return false; } diff --git a/MediaBrowser.Controller/Syncplay/ISyncplayController.cs b/MediaBrowser.Controller/Syncplay/ISyncplayController.cs index c9465b27a8..d35ae31019 100644 --- a/MediaBrowser.Controller/Syncplay/ISyncplayController.cs +++ b/MediaBrowser.Controller/Syncplay/ISyncplayController.cs @@ -28,29 +28,29 @@ namespace MediaBrowser.Controller.Syncplay bool IsGroupEmpty(); /// <summary> - /// Initializes the group with the user's info. + /// Initializes the group with the session's info. /// </summary> - /// <param name="user">The session.</param> - void InitGroup(SessionInfo user); + /// <param name="session">The session.</param> + void InitGroup(SessionInfo session); /// <summary> - /// Adds the user to the group. + /// Adds the session to the group. /// </summary> - /// <param name="user">The session.</param> - void UserJoin(SessionInfo user); + /// <param name="session">The session.</param> + void SessionJoin(SessionInfo session); /// <summary> - /// Removes the user from the group. + /// Removes the session from the group. /// </summary> - /// <param name="user">The session.</param> - void UserLeave(SessionInfo user); + /// <param name="session">The session.</param> + void SessionLeave(SessionInfo session); /// <summary> - /// Handles the requested action by the user. + /// Handles the requested action by the session. /// </summary> - /// <param name="user">The session.</param> + /// <param name="session">The session.</param> /// <param name="request">The requested action.</param> - void HandleRequest(SessionInfo user, SyncplayRequestInfo request); + void HandleRequest(SessionInfo session, SyncplayRequestInfo request); /// <summary> /// Gets the info about the group for the clients. diff --git a/MediaBrowser.Controller/Syncplay/ISyncplayManager.cs b/MediaBrowser.Controller/Syncplay/ISyncplayManager.cs index ec91ea69d3..09920a19ff 100644 --- a/MediaBrowser.Controller/Syncplay/ISyncplayManager.cs +++ b/MediaBrowser.Controller/Syncplay/ISyncplayManager.cs @@ -13,50 +13,50 @@ namespace MediaBrowser.Controller.Syncplay /// <summary> /// Creates a new group. /// </summary> - /// <param name="user">The user that's creating the group.</param> - void NewGroup(SessionInfo user); + /// <param name="session">The session that's creating the group.</param> + void NewGroup(SessionInfo session); /// <summary> - /// Adds the user to a group. + /// Adds the session to a group. /// </summary> - /// <param name="user">The session.</param> + /// <param name="session">The session.</param> /// <param name="groupId">The group id.</param> - void JoinGroup(SessionInfo user, string groupId); + void JoinGroup(SessionInfo session, string groupId); /// <summary> - /// Removes the user from a group. + /// Removes the session from a group. /// </summary> - /// <param name="user">The session.</param> - void LeaveGroup(SessionInfo user); + /// <param name="session">The session.</param> + void LeaveGroup(SessionInfo session); /// <summary> - /// Gets list of available groups for a user. + /// Gets list of available groups for a session. /// </summary> - /// <param name="user">The user.</param> + /// <param name="session">The session.</param> /// <value>The list of available groups.</value> - List<GroupInfoView> ListGroups(SessionInfo user); + List<GroupInfoView> ListGroups(SessionInfo session); /// <summary> - /// Handle a request by a user in a group. + /// Handle a request by a session in a group. /// </summary> - /// <param name="user">The session.</param> + /// <param name="session">The session.</param> /// <param name="request">The request.</param> - void HandleRequest(SessionInfo user, SyncplayRequestInfo request); + void HandleRequest(SessionInfo session, SyncplayRequestInfo request); /// <summary> - /// Maps a user to a group. + /// Maps a session to a group. /// </summary> - /// <param name="user">The user.</param> + /// <param name="session">The session.</param> /// <param name="group">The group.</param> /// <exception cref="InvalidOperationException"></exception> - void MapUserToGroup(SessionInfo user, ISyncplayController group); + void MapSessionToGroup(SessionInfo session, ISyncplayController group); /// <summary> - /// Unmaps a user from a group. + /// Unmaps a session from a group. /// </summary> - /// <param name="user">The user.</param> + /// <param name="session">The session.</param> /// <param name="group">The group.</param> /// <exception cref="InvalidOperationException"></exception> - void UnmapUserFromGroup(SessionInfo user, ISyncplayController group); + void UnmapSessionFromGroup(SessionInfo session, ISyncplayController group); } } |
