The Free Software Media System - Server Backend & API
fix a few warnings
dkanada6341d986a95b
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.csindex b1d513dd4f..ec3e875732 100644--- a/Emby.Server.Implementations/Session/SessionManager.cs+++ b/Emby.Server.Implementations/Session/SessionManager.cs@@ -67,15 +67,15 @@ namespace Emby.Server.Implementations.Sessionpublic event EventHandler<GenericEventArgs<AuthenticationResult>> AuthenticationSucceeded;/// <summary>- /// Occurs when [playback start].+ /// Occurs when playback has started./// </summary>public event EventHandler<PlaybackProgressEventArgs> PlaybackStart;/// <summary>- /// Occurs when [playback progress].+ /// Occurs when playback has progressed./// </summary>public event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;/// <summary>- /// Occurs when [playback stopped].+ /// Occurs when playback has stopped./// </summary>public event EventHandler<PlaybackStopEventArgs> PlaybackStopped;@@ -685,7 +685,7 @@ namespace Emby.Server.Implementations.Session}/// <summary>- /// Used to report playback progress for an item+ /// Used to report playback progress for an item./// </summary>/// <returns>Task.</returns>public async Task OnPlaybackProgress(PlaybackProgressInfo info, bool isAutomated)@@ -1435,14 +1435,13 @@ namespace Emby.Server.Implementations.SessionDeviceId = deviceId,UserId = user.Id,Limit = 1-}).Items.FirstOrDefault();- var allExistingForDevice = _authRepo.Get(new AuthenticationInfoQuery- {- DeviceId = deviceId-- }).Items;+ var allExistingForDevice = _authRepo.Get(+ new AuthenticationInfoQuery+ {+ DeviceId = deviceId+ }).Items;foreach (var auth in allExistingForDevice){@@ -1499,8 +1498,7 @@ namespace Emby.Server.Implementations.Session{Limit = 1,AccessToken = accessToken-- }).Items.FirstOrDefault();+ }).Items[0];if (existing != null){@@ -1708,7 +1706,8 @@ namespace Emby.Server.Implementations.Sessionpublic void ReportTranscodingInfo(string deviceId, TranscodingInfo info){- var session = Sessions.FirstOrDefault(i => string.Equals(i.DeviceId, deviceId));+ var session = Sessions.FirstOrDefault(i =>+ string.Equals(i.DeviceId, deviceId, StringComparison.OrdinalIgnoreCase));if (session != null){@@ -1723,8 +1722,9 @@ namespace Emby.Server.Implementations.Sessionpublic SessionInfo GetSession(string deviceId, string client, string version){- return Sessions.FirstOrDefault(i => string.Equals(i.DeviceId, deviceId) &&- string.Equals(i.Client, client));+ return Sessions.FirstOrDefault(i =>+ string.Equals(i.DeviceId, deviceId, StringComparison.OrdinalIgnoreCase)+ && string.Equals(i.Client, client, StringComparison.OrdinalIgnoreCase));}public SessionInfo GetSessionByAuthenticationToken(AuthenticationInfo info, string deviceId, string remoteEndpoint, string appVersion)diff --git a/MediaBrowser.Api/Session/SessionsService.cs b/MediaBrowser.Api/Session/SessionsService.csindex 700861c554..8e53490ffc 100644--- a/MediaBrowser.Api/Session/SessionsService.cs+++ b/MediaBrowser.Api/Session/SessionsService.cs@@ -276,7 +276,7 @@ namespace MediaBrowser.Api.Sessionpublic class SessionsService : BaseApiService{/// <summary>- /// The _session manager.+ /// The session manager./// </summary>private readonly ISessionManager _sessionManager;@@ -438,14 +438,12 @@ namespace MediaBrowser.Api.Sessionpublic Task Post(SendSystemCommand request){var name = request.Command;-if (Enum.TryParse(name, true, out GeneralCommandType commandType)){name = commandType.ToString();}var currentSession = GetSession(_sessionContext);-var command = new GeneralCommand{Name = name,@@ -518,16 +516,13 @@ namespace MediaBrowser.Api.Session{request.Id = GetSession(_sessionContext).Id;}+_sessionManager.ReportCapabilities(request.Id, new ClientCapabilities{PlayableMediaTypes = SplitValue(request.PlayableMediaTypes, ','),-SupportedCommands = SplitValue(request.SupportedCommands, ','),-SupportsMediaControl = request.SupportsMediaControl,-SupportsSync = request.SupportsSync,-SupportsPersistentIdentifier = request.SupportsPersistentIdentifier});}@@ -538,6 +533,7 @@ namespace MediaBrowser.Api.Session{request.Id = GetSession(_sessionContext).Id;}+_sessionManager.ReportCapabilities(request.Id, request);}}diff --git a/MediaBrowser.Api/UserLibrary/PlaystateService.cs b/MediaBrowser.Api/UserLibrary/PlaystateService.csindex 9d1cf5d9ee..d0faca163b 100644--- a/MediaBrowser.Api/UserLibrary/PlaystateService.cs+++ b/MediaBrowser.Api/UserLibrary/PlaystateService.cs@@ -103,10 +103,6 @@ namespace MediaBrowser.Api.UserLibrary[ApiMember(Name = "MediaSourceId", Description = "The id of the MediaSource", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]public string MediaSourceId { get; set; }- /// <summary>- /// Gets or sets a value indicating whether this <see cref="UpdateUserItemRating" /> is likes.- /// </summary>- /// <value><c>true</c> if likes; otherwise, <c>false</c>.</value>[ApiMember(Name = "CanSeek", Description = "Indicates if the client can seek", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "POST")]public bool CanSeek { get; set; }diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.csindex e1b01b012c..3b82dd9dd8 100644--- a/MediaBrowser.Api/UserService.cs+++ b/MediaBrowser.Api/UserService.cs@@ -240,7 +240,7 @@ namespace MediaBrowser.Apipublic class UserService : BaseApiService{/// <summary>- /// The _user manager+ /// The user manager./// </summary>private readonly IUserManager _userManager;private readonly ISessionManager _sessionMananger;diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.csindex acda6a4166..964fc9b191 100644--- a/MediaBrowser.Controller/Session/SessionInfo.cs+++ b/MediaBrowser.Controller/Session/SessionInfo.cs@@ -1,6 +1,5 @@using System;using System.Linq;-using System.Text.Json.Serialization;using System.Threading;using MediaBrowser.Controller.Entities;using MediaBrowser.Model.Dto;@@ -123,7 +122,6 @@ namespace MediaBrowser.Controller.Session/// Gets or sets the session controller./// </summary>/// <value>The session controller.</value>- [JsonIgnore]public ISessionController[] SessionControllers { get; set; }/// <summary>@@ -245,11 +243,6 @@ namespace MediaBrowser.Controller.SessionSessionControllers = controllers.ToArray();}- public bool ContainsUser(string userId)- {- return ContainsUser(new Guid(userId));- }-public bool ContainsUser(Guid userId){if (UserId.Equals(userId))