mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
Started to add support for deskmetrics
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user