Bläddra i källkod

Added isservice to reported statistics

Luke Pulverenti 11 år sedan
förälder
incheckning
1f6918117c

+ 6 - 0
MediaBrowser.Common.Implementations/BaseApplicationHost.cs

@@ -171,6 +171,12 @@ namespace MediaBrowser.Common.Implementations
         /// <value>The name.</value>
         public abstract string Name { get; }
 
+        /// <summary>
+        /// Gets a value indicating whether this instance is running as service.
+        /// </summary>
+        /// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
+        public abstract bool IsRunningAsService { get; }
+        
         /// <summary>
         /// Initializes a new instance of the <see cref="BaseApplicationHost{TApplicationPathsType}"/> class.
         /// </summary>

+ 12 - 5
MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/StatisticsTask.cs

@@ -1,6 +1,4 @@
-using System.Reflection;
-using MediaBrowser.Common.Configuration;
-using MediaBrowser.Common.Net;
+using MediaBrowser.Common.Net;
 using MediaBrowser.Common.ScheduledTasks;
 using MediaBrowser.Model.Logging;
 using System;
@@ -74,7 +72,16 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
 
             progress.Report(0);
             var mac = NetworkManager.GetMacAddress();
-            var data = new Dictionary<string, string> { { "feature", ApplicationHost.Name }, { "mac", mac }, { "ver", ApplicationHost.ApplicationVersion.ToString() }, { "platform", Environment.OSVersion.VersionString } };
+
+            var data = new Dictionary<string, string>
+            {
+                { "feature", ApplicationHost.Name }, 
+                { "mac", mac }, 
+                { "ver", ApplicationHost.ApplicationVersion.ToString() }, 
+                { "platform", Environment.OSVersion.VersionString }, 
+                { "isservice", ApplicationHost.IsRunningAsService.ToString().ToLower()}
+            };
+
             await HttpClient.Post(Constants.Constants.MbAdminUrl + "service/registration/ping", data, CancellationToken.None).ConfigureAwait(false);
             progress.Report(100);
 
@@ -86,7 +93,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
         /// <value>The name.</value>
         public string Name
         {
-            get { return "Collect stats"; }
+            get { return "Collect anonymous usage stats"; }
         }
 
         /// <summary>

+ 6 - 0
MediaBrowser.Common/IApplicationHost.cs

@@ -24,6 +24,12 @@ namespace MediaBrowser.Common
         /// </summary>
         event EventHandler<GenericEventArgs<Version>> ApplicationUpdated;
 
+        /// <summary>
+        /// Gets a value indicating whether this instance is running as service.
+        /// </summary>
+        /// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
+        bool IsRunningAsService { get; }
+
         /// <summary>
         /// Gets or sets a value indicating whether this instance has pending kernel reload.
         /// </summary>

+ 0 - 6
MediaBrowser.Controller/IServerApplicationHost.cs

@@ -20,12 +20,6 @@ namespace MediaBrowser.Controller
         /// <value>The name of the web application.</value>
         string WebApplicationName { get; }
 
-        /// <summary>
-        /// Gets a value indicating whether this instance is running as service.
-        /// </summary>
-        /// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
-        bool IsRunningAsService { get; }
-
         /// <summary>
         /// Gets a value indicating whether [supports automatic run at startup].
         /// </summary>

+ 1 - 1
MediaBrowser.ServerApplication/ApplicationHost.cs

@@ -186,7 +186,7 @@ namespace MediaBrowser.ServerApplication
         }
 
         private readonly bool _isRunningAsService;
-        public bool IsRunningAsService
+        public override bool IsRunningAsService
         {
             get { return _isRunningAsService; }
         }