Make device/session code async

This commit is contained in:
Patrick Barron
2021-04-10 16:57:25 -04:00
parent 44e71774b1
commit 8607b52541
14 changed files with 160 additions and 132 deletions

View File

@@ -50,6 +50,6 @@ namespace MediaBrowser.Controller.Devices
Task UpdateDeviceOptions(string deviceId, DeviceOptions options);
DeviceOptions GetDeviceOptions(string deviceId);
Task<DeviceOptions> GetDeviceOptions(string deviceId);
}
}

View File

@@ -1,5 +1,6 @@
#pragma warning disable CS1591
using System.Threading.Tasks;
using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Session;
using Microsoft.AspNetCore.Http;
@@ -8,12 +9,12 @@ namespace MediaBrowser.Controller.Net
{
public interface ISessionContext
{
SessionInfo GetSession(object requestContext);
Task<SessionInfo> GetSession(object requestContext);
User GetUser(object requestContext);
Task<User> GetUser(object requestContext);
SessionInfo GetSession(HttpContext requestContext);
Task<SessionInfo> GetSession(HttpContext requestContext);
User GetUser(HttpContext requestContext);
Task<User> GetUser(HttpContext requestContext);
}
}

View File

@@ -80,7 +80,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="deviceName">Name of the device.</param>
/// <param name="remoteEndPoint">The remote end point.</param>
/// <param name="user">The user.</param>
SessionInfo LogSessionActivity(string appName, string appVersion, string deviceId, string deviceName, string remoteEndPoint, Jellyfin.Data.Entities.User user);
Task<SessionInfo> LogSessionActivity(string appName, string appVersion, string deviceId, string deviceName, string remoteEndPoint, Jellyfin.Data.Entities.User user);
/// <summary>
/// Used to report that a session controller has connected.
@@ -313,7 +313,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="deviceId">The device identifier.</param>
/// <param name="remoteEndpoint">The remote endpoint.</param>
/// <returns>SessionInfo.</returns>
SessionInfo GetSessionByAuthenticationToken(string token, string deviceId, string remoteEndpoint);
Task<SessionInfo> GetSessionByAuthenticationToken(string token, string deviceId, string remoteEndpoint);
/// <summary>
/// Gets the session by authentication token.
@@ -323,7 +323,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="remoteEndpoint">The remote endpoint.</param>
/// <param name="appVersion">The application version.</param>
/// <returns>Task&lt;SessionInfo&gt;.</returns>
SessionInfo GetSessionByAuthenticationToken(AuthenticationInfo info, string deviceId, string remoteEndpoint, string appVersion);
Task<SessionInfo> GetSessionByAuthenticationToken(AuthenticationInfo info, string deviceId, string remoteEndpoint, string appVersion);
/// <summary>
/// Logouts the specified access token.