From 7e5036a5875cb7f03ad728f970d66471ca30236b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 22 Oct 2017 02:22:43 -0400 Subject: update image aspect ratio detection --- MediaBrowser.Api/Session/SessionsService.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'MediaBrowser.Api/Session/SessionsService.cs') diff --git a/MediaBrowser.Api/Session/SessionsService.cs b/MediaBrowser.Api/Session/SessionsService.cs index 8f54b591e..e961f9d51 100644 --- a/MediaBrowser.Api/Session/SessionsService.cs +++ b/MediaBrowser.Api/Session/SessionsService.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.Services; +using MediaBrowser.Controller; namespace MediaBrowser.Api.Session { @@ -293,15 +294,9 @@ namespace MediaBrowser.Api.Session private readonly IAuthenticationRepository _authRepo; private readonly IDeviceManager _deviceManager; private readonly ISessionContext _sessionContext; + private IServerApplicationHost _appHost; - /// - /// Initializes a new instance of the class. - /// - /// The session manager. - /// The user manager. - /// The authentication context. - /// The authentication repo. - public SessionsService(ISessionManager sessionManager, IUserManager userManager, IAuthorizationContext authContext, IAuthenticationRepository authRepo, IDeviceManager deviceManager, ISessionContext sessionContext) + public SessionsService(ISessionManager sessionManager, IServerApplicationHost appHost, IUserManager userManager, IAuthorizationContext authContext, IAuthenticationRepository authRepo, IDeviceManager deviceManager, ISessionContext sessionContext) { _sessionManager = sessionManager; _userManager = userManager; @@ -309,6 +304,7 @@ namespace MediaBrowser.Api.Session _authRepo = authRepo; _deviceManager = deviceManager; _sessionContext = sessionContext; + _appHost = appHost; } public void Delete(RevokeKey request) @@ -324,7 +320,10 @@ namespace MediaBrowser.Api.Session AppName = request.App, IsActive = true, AccessToken = Guid.NewGuid().ToString("N"), - DateCreated = DateTime.UtcNow + DateCreated = DateTime.UtcNow, + DeviceId = _appHost.SystemId, + DeviceName = _appHost.FriendlyName, + AppVersion = _appHost.ApplicationVersion.ToString() }, CancellationToken.None); } -- cgit v1.2.3