resolve version changing in now playing display
This commit is contained in:
parent
7adb3e4a23
commit
32e89f6deb
|
@ -775,7 +775,14 @@ namespace Emby.Server.Implementations
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put the app config in the log for troubleshooting purposes
|
// Put the app config in the log for troubleshooting purposes
|
||||||
Logger.LogMultiline("Application configuration:", LogSeverity.Info, new StringBuilder(JsonSerializer.SerializeToString(ConfigurationManager.CommonConfiguration)));
|
var configJson = new StringBuilder(JsonSerializer.SerializeToString(ConfigurationManager.CommonConfiguration));
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(ServerConfigurationManager.Configuration.CertificatePassword))
|
||||||
|
{
|
||||||
|
configJson = configJson.Replace(ServerConfigurationManager.Configuration.CertificatePassword, "####");
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.LogMultiline("Application configuration:", LogSeverity.Info, configJson);
|
||||||
|
|
||||||
if (Plugins != null)
|
if (Plugins != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,6 +5,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using MediaBrowser.Model.Services;
|
using MediaBrowser.Model.Services;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.HttpServer.Security
|
namespace Emby.Server.Implementations.HttpServer.Security
|
||||||
{
|
{
|
||||||
|
@ -95,23 +96,44 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
||||||
{
|
{
|
||||||
info.UserId = tokenInfo.UserId;
|
info.UserId = tokenInfo.UserId;
|
||||||
|
|
||||||
|
var updateToken = false;
|
||||||
|
|
||||||
// TODO: Remove these checks for IsNullOrWhiteSpace
|
// TODO: Remove these checks for IsNullOrWhiteSpace
|
||||||
if (string.IsNullOrWhiteSpace(info.Client))
|
if (string.IsNullOrWhiteSpace(info.Client))
|
||||||
{
|
{
|
||||||
info.Client = tokenInfo.AppName;
|
info.Client = tokenInfo.AppName;
|
||||||
}
|
}
|
||||||
if (string.IsNullOrWhiteSpace(info.Device))
|
|
||||||
{
|
|
||||||
info.Device = tokenInfo.DeviceName;
|
|
||||||
}
|
|
||||||
if (string.IsNullOrWhiteSpace(info.DeviceId))
|
if (string.IsNullOrWhiteSpace(info.DeviceId))
|
||||||
{
|
{
|
||||||
info.DeviceId = tokenInfo.DeviceId;
|
info.DeviceId = tokenInfo.DeviceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(info.Device))
|
||||||
|
{
|
||||||
|
info.Device = tokenInfo.DeviceName;
|
||||||
|
}
|
||||||
|
else if (!string.Equals(info.Device, tokenInfo.DeviceName, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
updateToken = true;
|
||||||
|
tokenInfo.DeviceName = info.Device;
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(info.Version))
|
if (string.IsNullOrWhiteSpace(info.Version))
|
||||||
{
|
{
|
||||||
info.Version = tokenInfo.AppVersion;
|
info.Version = tokenInfo.AppVersion;
|
||||||
}
|
}
|
||||||
|
else if (!string.Equals(info.Version, tokenInfo.AppVersion, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
updateToken = true;
|
||||||
|
tokenInfo.AppVersion = info.Version;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updateToken)
|
||||||
|
{
|
||||||
|
_authRepo.Update(tokenInfo, CancellationToken.None);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,15 +25,6 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
||||||
{
|
{
|
||||||
var authorization = _authContext.GetAuthorizationInfo(requestContext);
|
var authorization = _authContext.GetAuthorizationInfo(requestContext);
|
||||||
|
|
||||||
//if (!string.IsNullOrWhiteSpace(authorization.Token))
|
|
||||||
//{
|
|
||||||
// var auth = GetTokenInfo(requestContext);
|
|
||||||
// if (auth != null)
|
|
||||||
// {
|
|
||||||
// return _sessionManager.GetSessionByAuthenticationToken(auth, authorization.DeviceId, requestContext.RemoteIp, authorization.Version);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
var user = string.IsNullOrWhiteSpace(authorization.UserId) ? null : _userManager.GetUserById(authorization.UserId);
|
var user = string.IsNullOrWhiteSpace(authorization.UserId) ? null : _userManager.GetUserById(authorization.UserId);
|
||||||
return _sessionManager.LogSessionActivity(authorization.Client, authorization.Version, authorization.DeviceId, authorization.Device, requestContext.RemoteIp, user);
|
return _sessionManager.LogSessionActivity(authorization.Client, authorization.Version, authorization.DeviceId, authorization.Device, requestContext.RemoteIp, user);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.2.33.11")]
|
[assembly: AssemblyVersion("3.2.33.12")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user