Update to 3.5.2 and .net core 2.1

This commit is contained in:
stefan
2018-09-12 19:26:21 +02:00
parent c32d865638
commit 48facb797e
1419 changed files with 27525 additions and 88927 deletions

View File

@@ -1,5 +1,4 @@
using MediaBrowser.Common;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
@@ -61,17 +60,29 @@ namespace Emby.Server.Implementations.EntryPoints
var key = string.Join("_", keys.ToArray(keys.Count)).GetMD5();
_apps.GetOrAdd(key, guid => GetNewClientInfo(session));
ClientInfo info;
if (!_apps.TryGetValue(key, out info))
{
info = new ClientInfo
{
AppName = session.Client,
AppVersion = session.ApplicationVersion,
DeviceName = session.DeviceName,
DeviceId = session.DeviceId
};
_apps[key] = info;
if (_config.Configuration.EnableAnonymousUsageReporting)
{
Task.Run(() => ReportNewSession(info));
}
}
}
}
private async void ReportNewSession(ClientInfo client)
private async Task ReportNewSession(ClientInfo client)
{
if (!_config.Configuration.EnableAnonymousUsageReporting)
{
return;
}
try
{
await new UsageReporter(_applicationHost, _httpClient, _logger)
@@ -80,25 +91,10 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
_logger.ErrorException("Error sending anonymous usage statistics.", ex);
//_logger.ErrorException("Error sending anonymous usage statistics.", ex);
}
}
private ClientInfo GetNewClientInfo(SessionInfo session)
{
var info = new ClientInfo
{
AppName = session.Client,
AppVersion = session.ApplicationVersion,
DeviceName = session.DeviceName,
DeviceId = session.DeviceId
};
ReportNewSession(info);
return info;
}
public async void Run()
{
await Task.Delay(5000).ConfigureAwait(false);
@@ -123,14 +119,13 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
_logger.ErrorException("Error sending anonymous usage statistics.", ex);
//_logger.ErrorException("Error sending anonymous usage statistics.", ex);
}
}
public void Dispose()
{
_sessionManager.SessionStarted -= _sessionManager_SessionStarted;
GC.SuppressFinalize(this);
}
}
}