diff options
Diffstat (limited to 'MediaBrowser.Controller/Session')
| -rw-r--r-- | MediaBrowser.Controller/Session/ISessionManager.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Session/SessionInfo.cs | 28 |
2 files changed, 23 insertions, 11 deletions
diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 8d77e0747..603e5ef76 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -318,19 +318,19 @@ namespace MediaBrowser.Controller.Session /// </summary> /// <param name="accessToken">The access token.</param> /// <returns>Task.</returns> - Task Logout(string accessToken); + void Logout(string accessToken); /// <summary> /// Revokes the user tokens. /// </summary> /// <returns>Task.</returns> - Task RevokeUserTokens(string userId, string currentAccessToken); + void RevokeUserTokens(string userId, string currentAccessToken); /// <summary> /// Revokes the token. /// </summary> /// <param name="id">The identifier.</param> /// <returns>Task.</returns> - Task RevokeToken(string id); + void RevokeToken(string id); } }
\ No newline at end of file diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index 11a9ceac4..367a7a467 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -2,7 +2,6 @@ using MediaBrowser.Model.Session; using System; using System.Collections.Generic; -using System.Linq; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Threading; @@ -22,13 +21,13 @@ namespace MediaBrowser.Controller.Session _sessionManager = sessionManager; _logger = logger; - AdditionalUsers = new List<SessionUserInfo>(); + AdditionalUsers = new SessionUserInfo[] { }; PlayState = new PlayerStateInfo(); } public PlayerStateInfo PlayState { get; set; } - public List<SessionUserInfo> AdditionalUsers { get; set; } + public SessionUserInfo[] AdditionalUsers { get; set; } public ClientCapabilities Capabilities { get; set; } @@ -42,13 +41,13 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the playable media types. /// </summary> /// <value>The playable media types.</value> - public List<string> PlayableMediaTypes + public string[] PlayableMediaTypes { get { if (Capabilities == null) { - return new List<string>(); + return new string[] { }; } return Capabilities.PlayableMediaTypes; } @@ -138,13 +137,13 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the supported commands. /// </summary> /// <value>The supported commands.</value> - public List<string> SupportedCommands + public string[] SupportedCommands { get { if (Capabilities == null) { - return new List<string>(); + return new string[] { }; } return Capabilities.SupportedCommands; } @@ -194,7 +193,19 @@ namespace MediaBrowser.Controller.Session public bool ContainsUser(Guid userId) { - return (UserId ?? Guid.Empty) == userId || AdditionalUsers.Any(i => userId == new Guid(i.UserId)); + if ((UserId ?? Guid.Empty) == userId) + { + return true; + } + + foreach (var additionalUser in AdditionalUsers) + { + if (userId == new Guid(additionalUser.UserId)) + { + return true; + } + } + return false; } private readonly object _progressLock = new object(); @@ -292,6 +303,7 @@ namespace MediaBrowser.Controller.Session StopAutomaticProgress(); _sessionManager = null; + GC.SuppressFinalize(this); } } } |
