mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 18:42:42 +01:00
40 lines
870 B
C#
40 lines
870 B
C#
|
using System.Linq;
|
|||
|
using DeskMetrics;
|
|||
|
using Ninject;
|
|||
|
using NzbDrone.Common;
|
|||
|
|
|||
|
namespace NzbDrone.Core.Providers
|
|||
|
{
|
|||
|
public class AnalyticsProvider
|
|||
|
{
|
|||
|
private readonly IDeskMetricsClient _deskMetricsClient;
|
|||
|
public const string DESKMETRICS_ID = "4ea8d347a14ad71442000002";
|
|||
|
|
|||
|
[Inject]
|
|||
|
public AnalyticsProvider(IDeskMetricsClient deskMetricsClient)
|
|||
|
{
|
|||
|
_deskMetricsClient = deskMetricsClient;
|
|||
|
}
|
|||
|
|
|||
|
public AnalyticsProvider()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public virtual void Checkpoint()
|
|||
|
{
|
|||
|
if (_deskMetricsClient.Started)
|
|||
|
{
|
|||
|
_deskMetricsClient.Stop();
|
|||
|
}
|
|||
|
|
|||
|
if (EnviromentProvider.IsNewInstall)
|
|||
|
{
|
|||
|
_deskMetricsClient.RegisterInstall();
|
|||
|
}
|
|||
|
|
|||
|
_deskMetricsClient.Start();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|