mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-09 07:10:34 +02:00
switch to device name
This commit is contained in:
parent
ad96be8fa7
commit
29ba865ab8
|
@ -49,7 +49,7 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||||
{
|
{
|
||||||
public string AppName { get; set; }
|
public string AppName { get; set; }
|
||||||
public string AppVersion { get; set; }
|
public string AppVersion { get; set; }
|
||||||
public string DeviceVersion { get; set; }
|
public string DeviceName { get; set; }
|
||||||
public string DeviceId { get; set; }
|
public string DeviceId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,12 +86,6 @@ namespace MediaBrowser.Controller.Session
|
||||||
/// <value>The name of the device.</value>
|
/// <value>The name of the device.</value>
|
||||||
public string DeviceName { get; set; }
|
public string DeviceName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the device version.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The device version.</value>
|
|
||||||
public string DeviceVersion { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the name of the now viewing item.
|
/// Gets or sets the name of the now viewing item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -46,24 +46,17 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(session.Client) &&
|
if (!string.IsNullOrEmpty(session.Client) &&
|
||||||
!string.IsNullOrEmpty(session.DeviceName) &&
|
!string.IsNullOrEmpty(session.DeviceName) &&
|
||||||
!string.IsNullOrEmpty(session.DeviceId))
|
!string.IsNullOrEmpty(session.DeviceId) &&
|
||||||
|
!string.IsNullOrEmpty(session.ApplicationVersion))
|
||||||
{
|
{
|
||||||
var keys = new List<string>
|
var keys = new List<string>
|
||||||
{
|
{
|
||||||
session.Client,
|
session.Client,
|
||||||
session.DeviceName,
|
session.DeviceName,
|
||||||
session.DeviceId
|
session.DeviceId,
|
||||||
|
session.ApplicationVersion
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(session.DeviceVersion))
|
|
||||||
{
|
|
||||||
keys.Add(session.DeviceVersion);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
keys.Add(DefaultDeviceVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
var key = string.Join("_", keys.ToArray()).GetMD5();
|
var key = string.Join("_", keys.ToArray()).GetMD5();
|
||||||
|
|
||||||
_apps.GetOrAdd(key, guid => GetNewClientInfo(session));
|
_apps.GetOrAdd(key, guid => GetNewClientInfo(session));
|
||||||
|
@ -90,15 +83,10 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
{
|
{
|
||||||
AppName = session.Client,
|
AppName = session.Client,
|
||||||
AppVersion = session.ApplicationVersion,
|
AppVersion = session.ApplicationVersion,
|
||||||
DeviceVersion = session.DeviceVersion,
|
DeviceName = session.DeviceName,
|
||||||
DeviceId = session.DeviceId
|
DeviceId = session.DeviceId
|
||||||
};
|
};
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(info.DeviceVersion))
|
|
||||||
{
|
|
||||||
info.DeviceVersion = DefaultDeviceVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Report usage to remote server, except for web client, since we already have data on that
|
// Report usage to remote server, except for web client, since we already have data on that
|
||||||
if (!string.Equals(info.AppName, "Dashboard", StringComparison.OrdinalIgnoreCase))
|
if (!string.Equals(info.AppName, "Dashboard", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue