mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
add system id to remote calls
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Events;
|
||||
using MediaBrowser.Common.Implementations.Archiving;
|
||||
using MediaBrowser.Common.Implementations.Devices;
|
||||
using MediaBrowser.Common.Implementations.IO;
|
||||
using MediaBrowser.Common.Implementations.ScheduledTasks;
|
||||
using MediaBrowser.Common.Implementations.Security;
|
||||
@@ -178,6 +179,20 @@ namespace MediaBrowser.Common.Implementations
|
||||
/// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
|
||||
public abstract bool IsRunningAsService { get; }
|
||||
|
||||
private DeviceId _deviceId;
|
||||
public string SystemId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_deviceId == null)
|
||||
{
|
||||
_deviceId = new DeviceId(ApplicationPaths, LogManager.GetLogger("SystemId"));
|
||||
}
|
||||
|
||||
return _deviceId.Value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BaseApplicationHost{TApplicationPathsType}"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -203,6 +203,7 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||
{ "feature", feature },
|
||||
{ "key", SupporterKey },
|
||||
{ "mac", mac },
|
||||
{ "systemid", _appHost.SystemId },
|
||||
{ "mb2equiv", mb2Equivalent },
|
||||
{ "ver", version },
|
||||
{ "platform", Environment.OSVersion.VersionString },
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||
{
|
||||
{ "feature", _applicationHost.Name },
|
||||
{ "mac", mac },
|
||||
{ "systemid", _applicationHost.SystemId },
|
||||
{ "ver", _applicationHost.ApplicationVersion.ToString() },
|
||||
{ "platform", Environment.OSVersion.VersionString },
|
||||
{ "isservice", _applicationHost.IsRunningAsService.ToString().ToLower()}
|
||||
@@ -40,12 +41,18 @@ namespace MediaBrowser.Common.Implementations.Security
|
||||
|
||||
public Task ReportAppUsage(ClientInfo app, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(app.DeviceId))
|
||||
{
|
||||
throw new ArgumentException("Client info must have a device Id");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var data = new Dictionary<string, string>
|
||||
{
|
||||
{ "feature", app.AppName ?? "Unknown App" },
|
||||
{ "mac", app.DeviceId ?? _networkManager.GetMacAddress() },
|
||||
{ "systemid", _applicationHost.SystemId },
|
||||
{ "mac", app.DeviceId },
|
||||
{ "ver", app.AppVersion ?? "Unknown" },
|
||||
{ "platform", app.DeviceName },
|
||||
};
|
||||
|
||||
@@ -154,7 +154,12 @@ namespace MediaBrowser.Common.Implementations.Updates
|
||||
PackageType? packageType = null,
|
||||
Version applicationVersion = null)
|
||||
{
|
||||
var data = new Dictionary<string, string> { { "key", _securityManager.SupporterKey }, { "mac", _networkManager.GetMacAddress() } };
|
||||
var data = new Dictionary<string, string>
|
||||
{
|
||||
{ "key", _securityManager.SupporterKey },
|
||||
{ "mac", _networkManager.GetMacAddress() },
|
||||
{ "systemid", _applicationHost.SystemId }
|
||||
};
|
||||
|
||||
using (var json = await _httpClient.Post(Constants.Constants.MbAdminUrl + "service/package/retrieveall", data, cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user