mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Added google analytics. (only enabled in production)
This commit is contained in:
parent
eb84583f68
commit
5b3f0bdffe
4 changed files with 40 additions and 14 deletions
|
@ -7,23 +7,20 @@ namespace NzbDrone.Common
|
|||
{
|
||||
public class EnviromentProvider
|
||||
{
|
||||
public virtual String LogPath
|
||||
{
|
||||
get { return Environment.CurrentDirectory; }
|
||||
}
|
||||
|
||||
public virtual bool IsUserInteractive
|
||||
{
|
||||
get { return Environment.UserInteractive; }
|
||||
}
|
||||
#if DEBUG
|
||||
private static readonly bool isInDebug = true;
|
||||
#else
|
||||
private static readonly bool isInDebug = false;
|
||||
#endif
|
||||
|
||||
private static readonly string processName = Process.GetCurrentProcess().ProcessName.ToLower();
|
||||
|
||||
public static bool IsProduction
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Debugger.IsAttached) return false;
|
||||
|
||||
var processName = Process.GetCurrentProcess().ProcessName.ToLower();
|
||||
if (isInDebug || Debugger.IsAttached) return false;
|
||||
|
||||
Console.WriteLine(processName);
|
||||
if (processName.Contains("nunit")) return false;
|
||||
|
@ -34,6 +31,16 @@ namespace NzbDrone.Common
|
|||
}
|
||||
}
|
||||
|
||||
public virtual String LogPath
|
||||
{
|
||||
get { return Environment.CurrentDirectory; }
|
||||
}
|
||||
|
||||
public virtual bool IsUserInteractive
|
||||
{
|
||||
get { return Environment.UserInteractive; }
|
||||
}
|
||||
|
||||
public virtual string ApplicationPath
|
||||
{
|
||||
get
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue